Reworked the signal change to work with per-6.2.0 PyQt releases. eric7

Thu, 09 Sep 2021 19:04:53 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 09 Sep 2021 19:04:53 +0200
branch
eric7
changeset 8586
6a315398a554
parent 8585
c9996d52a1b9
child 8587
78971b458d25

Reworked the signal change to work with per-6.2.0 PyQt releases.

eric7/EricNetwork/EricNetworkIcon.py file | annotate | diff | comparison | revisions
eric7/PluginManager/PluginRepositoryDialog.py file | annotate | diff | comparison | revisions
eric7/WebBrowser/SpellCheck/ManageDictionariesDialog.py file | annotate | diff | comparison | revisions
diff -r c9996d52a1b9 -r 6a315398a554 eric7/EricNetwork/EricNetworkIcon.py
--- a/eric7/EricNetwork/EricNetworkIcon.py	Wed Sep 08 19:53:16 2021 +0200
+++ b/eric7/EricNetwork/EricNetworkIcon.py	Thu Sep 09 19:04:53 2021 +0200
@@ -7,7 +7,7 @@
 Module implementing a statusbar icon tracking the network status.
 """
 
-from PyQt6.QtCore import pyqtSlot, pyqtSignal
+from PyQt6.QtCore import pyqtSignal
 from PyQt6.QtNetwork import QNetworkInformation
 from PyQt6.QtWidgets import QLabel
 
@@ -47,8 +47,11 @@
             self.__reachabilityChanged(
                 QNetworkInformation.instance().reachability())
             
-            QNetworkInformation.instance().reachabilityChanged.connect(
-                self.__reachabilityChanged)
+            # TODO: remove this 'contextlib' with official relelase
+            import contextlib
+            with contextlib.suppress(Exception):
+                QNetworkInformation.instance().reachabilityChanged.connect(
+                    self.__reachabilityChanged)
         else:
             # assume to be 'always online' if no backend could be loaded or
             # dynamic online check is switched of
diff -r c9996d52a1b9 -r 6a315398a554 eric7/PluginManager/PluginRepositoryDialog.py
--- a/eric7/PluginManager/PluginRepositoryDialog.py	Wed Sep 08 19:53:16 2021 +0200
+++ b/eric7/PluginManager/PluginRepositoryDialog.py	Thu Sep 09 19:04:53 2021 +0200
@@ -148,8 +148,11 @@
         ):
             self.__reachabilityChanged(
                 QNetworkInformation.instance().reachability())
-            QNetworkInformation.instance().reachabilityChanged.connect(
-                self.__reachabilityChanged)
+            # TODO: remove this 'contextlib' with official relelase
+            import contextlib
+            with contextlib.suppress(Exception):
+                QNetworkInformation.instance().reachabilityChanged.connect(
+                    self.__reachabilityChanged)
         else:
             # assume to be 'always online' if no backend could be loaded or
             # dynamic online check is switched of
diff -r c9996d52a1b9 -r 6a315398a554 eric7/WebBrowser/SpellCheck/ManageDictionariesDialog.py
--- a/eric7/WebBrowser/SpellCheck/ManageDictionariesDialog.py	Wed Sep 08 19:53:16 2021 +0200
+++ b/eric7/WebBrowser/SpellCheck/ManageDictionariesDialog.py	Thu Sep 09 19:04:53 2021 +0200
@@ -75,8 +75,11 @@
         ):
             self.__reachabilityChanged(
                 QNetworkInformation.instance().reachability())
-            QNetworkInformation.instance().reachabilityChanged.connect(
-                self.__reachabilityChanged)
+            # TODO: remove this 'contextlib' with official relelase
+            import contextlib
+            with contextlib.suppress(Exception):
+                QNetworkInformation.instance().reachabilityChanged.connect(
+                    self.__reachabilityChanged)
         else:
             # assume to be 'always online' if no backend could be loaded or
             # dynamic online check is switched of

eric ide

mercurial