src/eric7/Plugins/PluginCodeStyleChecker.py

branch
eric7
changeset 10836
dc7f25f2f7e4
parent 10738
37101524dd76
child 10859
399d19fc7eb5
--- a/src/eric7/Plugins/PluginCodeStyleChecker.py	Tue Jul 09 14:09:40 2024 +0200
+++ b/src/eric7/Plugins/PluginCodeStyleChecker.py	Tue Jul 09 17:20:18 2024 +0200
@@ -173,15 +173,12 @@
         @type list of (str, str, bool, str, str, bool, int, list of (int, int),
             bool, str, dict, dict, list of str, str, str, bool)
         """
-        if lang is None:
-            lang = "Python{0}".format(
-                PythonUtilities.determinePythonVersion(filename, source)
-            )
-        if lang != "Python3":
-            return
-
-        data = [source, args]
-        self.backgroundService.enqueueRequest("style", lang, filename, data)
+        if (
+            (lang is None and PythonUtilities.isPythonSource(filename, source))
+            or (lang is not None and lang == "Python3")
+        ):
+            data = [source, args]
+            self.backgroundService.enqueueRequest("style", "Python3", filename, data)
 
     def styleBatchCheck(self, argumentsList):
         """
@@ -196,13 +193,8 @@
             "Python3": [],
         }
         for filename, source, args in argumentsList:
-            lang = "Python{0}".format(
-                PythonUtilities.determinePythonVersion(filename, source)
-            )
-            if lang != "Python3":
-                continue
-            else:
-                data[lang].append((filename, source, args))
+            if PythonUtilities.isPythonSource(filename, source):
+                data["Python3"].append((filename, source, args))
 
         self.queuedBatches = []
         if data["Python3"]:

eric ide

mercurial