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

branch
maintenance
changeset 8273
698ae46f40a4
parent 8259
2bbec88047dd
diff -r fb0ef164f536 -r 698ae46f40a4 eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py	Fri Apr 02 11:59:41 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/tryExcept.py	Sat May 01 14:27:20 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