src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py

branch
eric7
changeset 9327
2b768afcaee1
parent 9325
8157eb19aba5
child 9653
e67609152c5e
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py	Wed Sep 14 11:07:55 2022 +0200
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py	Thu Sep 15 10:09:53 2022 +0200
@@ -61,7 +61,7 @@
         if (
             not checkTypedException
             and node.type is not None
-            and getattr(node.type, "id", None) != "Exception"
+            and getattr(node.type, "id", None) not in ("BaseException", "Exception")
         ):
             return
 
@@ -97,7 +97,7 @@
         if (
             not checkTypedException
             and node.type is not None
-            and getattr(node.type, "id", None) != "Exception"
+            and getattr(node.type, "id", None) not in ("BaseException", "Exception")
         ):
             return
 
@@ -136,7 +136,11 @@
     qualnameList = qualname.split(".")
     func = qualnameList[-1]
     if func == "suppress":
-        if not checkTypedException and "Exception" not in context.callArgs:
+        if (
+            not checkTypedException
+            and "Exception" not in context.callArgs
+            and "BaseException" not in context.callArgs
+        ):
             return
 
         reportError(

eric ide

mercurial