eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py

changeset 8212
91015c7ace79
parent 8211
8322a6f219ff
child 8216
6a042a54e0f7
diff -r 8322a6f219ff -r 91015c7ace79 eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py	Sat Apr 10 15:11:43 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py	Sat Apr 10 15:18:24 2021 +0200
@@ -605,10 +605,13 @@
                 finallyReturn = stmt
                 break
 
-        if (tryHasReturn or exceptHasReturn) and finallyHasReturn:
-            if finallyReturn is not None:
-                self.__error(finallyReturn.lineno - 1,
-                             finallyReturn.col_offset, "Y107")
+        if (
+            (tryHasReturn or exceptHasReturn) and
+            finallyHasReturn and
+            finallyReturn is not None
+        ):
+            self.__error(finallyReturn.lineno - 1,
+                         finallyReturn.col_offset, "Y107")
     
     def __check108(self, node):
         """
@@ -1579,7 +1582,7 @@
         )
         isException = isException or (
             isinstance(node.func, ast.Attribute) and
-            node.func.attr in ["get", "insert",]
+            node.func.attr in ("get", "insert")
         )
         
         if hasBareNumeric and not isException:

eric ide

mercurial