eric6/DebugClients/Python/QProcessExtension.py

branch
multi_processing
changeset 7419
9c1163735448
parent 7412
0a995393d2ba
child 7424
9bb7d8b0f966
diff -r 6214fa980a9d -r 9c1163735448 eric6/DebugClients/Python/QProcessExtension.py
--- a/eric6/DebugClients/Python/QProcessExtension.py	Sat Feb 15 16:30:08 2020 +0100
+++ b/eric6/DebugClients/Python/QProcessExtension.py	Sat Feb 15 20:00:22 2020 +0100
@@ -78,7 +78,7 @@
                         mode = args[0]
                     else:
                         mode = module.QIODevice.ReadWrite
-                ok, (program, arguments) = isPythonProgram(program, arguments)
+                ok = isPythonProgram(program)
                 if (
                     ok and (
                         not os.path.basename(arguments[0])
@@ -86,12 +86,14 @@
                     )
                 ):
                     newArgs = patchArguments(
-                        arguments, _debugClient.multiprocessSupport)
-                    super(QProcessWrapper, self).start(program, newArgs, mode)
-                else:
-                    super(QProcessWrapper, self).start(*args, **kwargs)
-            else:
-                super(QProcessWrapper, self).start(*args, **kwargs)
+                        _debugClient,
+                        [program] + arguments,
+                    )
+                    super(QProcessWrapper, self).start(
+                        newArgs[0], newArgs[1:], mode)
+                    return
+            
+            super(QProcessWrapper, self).start(*args, **kwargs)
         
         ###################################################################
         ## Handling of 'startDetached(...)' below
@@ -142,16 +144,12 @@
                 arguments = self.arguments()
                 wd = self.workingDirectory()
                 
-                ok, (program, arguments) = isPythonProgram(program, arguments)
+                ok = isPythonProgram(program)
                 if ok:
                     return QProcessWrapper.startDetachedStatic(
                         program, arguments, wd)
-                else:
-                    return super(QProcessWrapper, self).startDetached(
-                        *args, **kwargs)
-            else:
-                return super(QProcessWrapper, self).startDetached(
-                    *args, **kwargs)
+            
+            return super(QProcessWrapper, self).startDetached(*args, **kwargs)
         
         @staticmethod
         def startDetachedStatic(*args, **kwargs):
@@ -180,18 +178,17 @@
                     wd = args[2]
                 else:
                     wd = ""
-                ok, (program, arguments) = isPythonProgram(program, arguments)
+                ok = isPythonProgram(program)
                 if ok:
                     newArgs = patchArguments(
-                        arguments, _debugClient.multiprocessSupport)
-                    return QProcessWrapper._origQProcessStartDetached(
-                        program, newArgs, wd)
-                else:
+                        _debugClient,
+                        [program] + arguments,
+                    )
                     return QProcessWrapper._origQProcessStartDetached(
-                        *args, **kwargs)
-            else:
-                return QProcessWrapper._origQProcessStartDetached(
-                    *args, **kwargs)
+                        newArgs[0], newArgs[1:], wd)
+            
+            return QProcessWrapper._origQProcessStartDetached(
+                *args, **kwargs)
     
     _debugClient = debugClient
     module.QProcess = QProcessWrapper

eric ide

mercurial