From 852bc9acd9a24ba79731d8a34fb805ac16c5df6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sun, 1 Nov 2020 10:06:32 +0100 Subject: [PATCH] Gmail.py use hardcoded url variable 2/2 Because the call in the if and in the else blocks is the same, we can move it outside the conditional block. Code now is clear. --- offlineimap/repository/Gmail.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/offlineimap/repository/Gmail.py b/offlineimap/repository/Gmail.py index 6509701..b94726b 100644 --- a/offlineimap/repository/Gmail.py +++ b/offlineimap/repository/Gmail.py @@ -57,11 +57,11 @@ class GmailRepository(IMAPRepository): url = super().getoauth2_request_url() if url is None: - # Nothing was configured, cache and return hardcoded one. + # Nothing was configured, use a hardcoded one. url = "https://accounts.google.com/o/oauth2/token" - self.setoauth2_request_url(url) - else: - self.setoauth2_request_url(url) + + self.setoauth2_request_url(url) + return self.oauth2_request_url def getport(self):