fix pylint warning '(redefine-in-handler) Redefining name 'X' from outer scope (line Y) in exception handler'
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 17 Oct 2017 11:29:20 +0300
changeset 1875 62aaabbf8812
parent 1874 a347459df3a4
child 1876 995df4804221
fix pylint warning '(redefine-in-handler) Redefining name 'X' from outer scope (line Y) in exception handler'
PLCControler.py
tests/tools/check_source.sh
--- a/PLCControler.py	Tue Oct 17 11:09:01 2017 +0300
+++ b/PLCControler.py	Tue Oct 17 11:29:20 2017 +0300
@@ -912,8 +912,8 @@
                     programfile.close()
                     self.ProgramFilePath = filepath
                 return program_text, errors, warnings
-            except PLCGenException, e:
-                errors.append(e.message)
+            except PLCGenException, ex:
+                errors.append(ex.message)
         else:
             errors.append("No project opened")
         return "", errors, warnings
--- a/tests/tools/check_source.sh	Tue Oct 17 11:09:01 2017 +0300
+++ b/tests/tools/check_source.sh	Tue Oct 17 11:29:20 2017 +0300
@@ -260,6 +260,9 @@
     enable=$enable,E1121          # (too-many-function-args) Too many positional arguments for function call
     enable=$enable,E0602          # (undefined-variable) Undefined variable 'X'
     enable=$enable,W0232          # (no-init) Class has no __init__ method
+    enable=$enable,W0233          # (non-parent-init-called) __init__ method from a non direct base class 'X' is called
+    enable=$enable,W0601          # (global-variable-undefined) Global variable 'X' undefined at the module level
+    enable=$enable,W0623          # (redefine-in-handler) Redefining name 'X' from outer scope (line Y) in exception handler
     # enable=
 
     options=