eric6/E5Network/E5GoogleMail.py

changeset 8243
cc717c2ae956
parent 8218
7c09585bd960
diff -r aa713ac50c0d -r cc717c2ae956 eric6/E5Network/E5GoogleMail.py
--- a/eric6/E5Network/E5GoogleMail.py	Thu Apr 15 16:52:05 2021 +0200
+++ b/eric6/E5Network/E5GoogleMail.py	Thu Apr 15 18:11:24 2021 +0200
@@ -11,6 +11,7 @@
 import base64
 import json
 import datetime
+import contextlib
 
 from googleapiclient import discovery
 from google.oauth2.credentials import Credentials
@@ -182,12 +183,10 @@
                 prompt="select_account"
             )
             if self.__browser is None:
-                try:
+                with contextlib.suppress(ImportError):
                     self.__browser = E5GoogleMailAuthBrowser()
                     self.__browser.approvalCodeReceived.connect(
                         self.__processAuthorization)
-                except ImportError:
-                    pass
             if self.__browser:
                 self.__browser.show()
                 self.__browser.load(QUrl(authorizationUrl))

eric ide

mercurial