eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py

changeset 8259
2bbec88047dd
parent 7923
91e843545d9a
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py	Wed Apr 21 17:56:12 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py	Wed Apr 21 19:40:50 2021 +0200
@@ -47,10 +47,11 @@
     @param config dictionary with configuration data
     @type dict
     """
-    if config and "check_typed_exception" in config:
-        checkTypedException = config["check_typed_exception"]
-    else:
-        checkTypedException = SecurityDefaults["check_typed_exception"]
+    checkTypedException = (
+        config["check_typed_exception"]
+        if config and "check_typed_exception" in config else
+        SecurityDefaults["check_typed_exception"]
+    )
     
     node = context.node
     if len(node.body) == 1:
@@ -82,10 +83,11 @@
     @param config dictionary with configuration data
     @type dict
     """
-    if config and "check_typed_exception" in config:
-        checkTypedException = config["check_typed_exception"]
-    else:
-        checkTypedException = SecurityDefaults["check_typed_exception"]
+    checkTypedException = (
+        config["check_typed_exception"]
+        if config and "check_typed_exception" in config else
+        SecurityDefaults["check_typed_exception"]
+    )
     
     node = context.node
     if len(node.body) == 1:

eric ide

mercurial