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

changeset 7637
c878e8255972
parent 7614
646742c260bd
child 7923
91e843545d9a
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/exec.py	Mon Jun 22 17:55:06 2020 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/exec.py	Tue Jun 23 17:24:18 2020 +0200
@@ -15,8 +15,6 @@
 # SPDX-License-Identifier: Apache-2.0
 #
 
-import sys
-
 
 def getChecks():
     """
@@ -26,18 +24,11 @@
         list of codes
     @rtype dict
     """
-    if sys.version_info[0] == 2:
-        return {
-            "Exec": [
-                (checkExecUsed, ("S102",)),
-            ],
-        }
-    else:
-        return {
-            "Call": [
-                (checkExecUsed, ("S102",)),
-            ],
-        }
+    return {
+        "Call": [
+            (checkExecUsed, ("S102",)),
+        ],
+    }
 
 
 def checkExecUsed(reportError, context, config):
@@ -51,10 +42,7 @@
     @param config dictionary with configuration data
     @type dict
     """
-    if (
-        sys.version_info[0] == 2 or
-        context.callFunctionNameQual == 'exec'
-    ):
+    if context.callFunctionNameQual == 'exec':
         reportError(
             context.node.lineno - 1,
             context.node.col_offset,

eric ide

mercurial