eric6/E5Gui/E5ErrorMessage.py

changeset 8243
cc717c2ae956
parent 8221
0572a215bd2f
child 8257
28146736bbfc
diff -r aa713ac50c0d -r cc717c2ae956 eric6/E5Gui/E5ErrorMessage.py
--- a/eric6/E5Gui/E5ErrorMessage.py	Thu Apr 15 16:52:05 2021 +0200
+++ b/eric6/E5Gui/E5ErrorMessage.py	Thu Apr 15 18:11:24 2021 +0200
@@ -7,6 +7,8 @@
 Module implementing a specialized error message dialog.
 """
 
+import contextlib
+
 from PyQt5.QtCore import (
     qInstallMessageHandler, QtDebugMsg, QtWarningMsg, QtCriticalMsg,
     QtFatalMsg, QThread, QMetaObject, Qt, Q_ARG, QSettings
@@ -118,7 +120,7 @@
             # just ignore the message
             return
         
-        try:
+        with contextlib.suppress(RuntimeError):
             if msgType == QtDebugMsg:
                 messageType = "Debug Message:"
             elif msgType == QtWarningMsg:
@@ -154,8 +156,6 @@
                     Qt.ConnectionType.QueuedConnection,
                     Q_ARG(str, msg))
             return
-        except RuntimeError:
-            pass
     elif _origMsgHandler:
         _origMsgHandler(msgType, message)
         return

eric ide

mercurial