src/eric7/DebugClients/Python/DebugUtilities.py

branch
eric7
changeset 9500
5771348ded12
parent 9473
3f23dbf37dbe
child 9571
0e2ab682dfa3
diff -r dd389c57c2f0 -r 5771348ded12 src/eric7/DebugClients/Python/DebugUtilities.py
--- a/src/eric7/DebugClients/Python/DebugUtilities.py	Wed Nov 09 11:32:13 2022 +0100
+++ b/src/eric7/DebugClients/Python/DebugUtilities.py	Wed Nov 09 15:05:06 2022 +0100
@@ -200,12 +200,11 @@
                 for line in f:
                     line = line.strip()
                     if line:
-                        for name in PYTHON_NAMES:  # __IGNORE_WARNING_Y110__
-                            if line.startswith("#!/usr/bin/env {0}".format(name)) or (
-                                line.startswith("#!") and name in line
-                            ):
-                                return True
-                        return False
+                        return any(
+                            line.startswith("#!/usr/bin/env {0}".format(name))
+                            or (line.startswith("#!") and name in line)
+                            for name in PYTHON_NAMES
+                        )
         else:
             return False
     except UnicodeDecodeError:

eric ide

mercurial