eric6/DebugClients/Python/QProcessExtension.py

branch
multi_processing
changeset 7424
9bb7d8b0f966
parent 7419
9c1163735448
child 7901
6ff7ccf0cb50
--- a/eric6/DebugClients/Python/QProcessExtension.py	Sun Feb 16 19:36:46 2020 +0100
+++ b/eric6/DebugClients/Python/QProcessExtension.py	Mon Feb 17 19:23:27 2020 +0100
@@ -10,7 +10,7 @@
 
 import os
 
-from DebugUtilities import isPythonProgram, patchArguments
+from DebugUtilities import isPythonProgram, startsWithShebang, patchArguments
 
 _debugClient = None
 
@@ -79,19 +79,19 @@
                     else:
                         mode = module.QIODevice.ReadWrite
                 ok = isPythonProgram(program)
-                if (
-                    ok and (
-                        not os.path.basename(arguments[0])
-                        in _debugClient.noDebugList
-                    )
-                ):
-                    newArgs = patchArguments(
-                        _debugClient,
-                        [program] + arguments,
-                    )
-                    super(QProcessWrapper, self).start(
-                        newArgs[0], newArgs[1:], mode)
-                    return
+                if ok:
+                    if startsWithShebang(program):
+                        scriptName = os.path.basename(program)
+                    else:
+                        scriptName = os.path.basename(arguments[0])
+                    if scriptName not in _debugClient.noDebugList:
+                        newArgs = patchArguments(
+                            _debugClient,
+                            [program] + arguments,
+                        )
+                        super(QProcessWrapper, self).start(
+                            newArgs[0], newArgs[1:], mode)
+                        return
             
             super(QProcessWrapper, self).start(*args, **kwargs)
         
@@ -180,12 +180,17 @@
                     wd = ""
                 ok = isPythonProgram(program)
                 if ok:
-                    newArgs = patchArguments(
-                        _debugClient,
-                        [program] + arguments,
-                    )
-                    return QProcessWrapper._origQProcessStartDetached(
-                        newArgs[0], newArgs[1:], wd)
+                    if startsWithShebang(program):
+                        scriptName = os.path.basename(program)
+                    else:
+                        scriptName = os.path.basename(arguments[0])
+                    if scriptName not in _debugClient.noDebugList:
+                        newArgs = patchArguments(
+                            _debugClient,
+                            [program] + arguments,
+                        )
+                        return QProcessWrapper._origQProcessStartDetached(
+                            newArgs[0], newArgs[1:], wd)
             
             return QProcessWrapper._origQProcessStartDetached(
                 *args, **kwargs)

eric ide

mercurial