53 and _debugClient.multiprocessSupport |
54 and _debugClient.multiprocessSupport |
54 and isinstance(args, (str, list)) |
55 and isinstance(args, (str, list)) |
55 ): |
56 ): |
56 if isinstance(args, str): |
57 if isinstance(args, str): |
57 # convert to arguments list |
58 # convert to arguments list |
58 args = ( |
59 args_list = ( |
59 stringToArgumentsWindows(args) |
60 stringToArgumentsWindows(args) |
60 if isWindowsPlatform() |
61 if isWindowsPlatform() |
61 else shlex.split(args) |
62 else shlex.split(args) |
62 ) |
63 ) |
63 else: |
64 else: |
64 # create a copy of the arguments |
65 # create a copy of the arguments |
65 args = args[:] |
66 args_list = args[:] |
66 ok = isPythonProgram(args[0]) |
67 isPythonProg = isPythonProgram( |
67 if ok: |
68 args_list[0], |
68 scriptName = os.path.basename(args[0]) |
69 withPath="shell" in kwargs and kwargs["shell"] is True, |
|
70 ) |
|
71 if isPythonProg: |
|
72 scriptName = os.path.basename(args_list[0]) |
69 if not _debugClient.skipMultiProcessDebugging(scriptName): |
73 if not _debugClient.skipMultiProcessDebugging(scriptName): |
70 args = patchArguments(_debugClient, args, noRedirect=True) |
74 if ( |
71 if "shell" in kwargs and kwargs["shell"] is True: |
75 "shell" in kwargs |
72 # shell=True interferes with eric debugger |
76 and kwargs["shell"] is True |
73 kwargs["shell"] = False |
77 and not os.path.isabs(args_list[0]) |
|
78 ): |
|
79 prog = shutil.which(args_list[0]) |
|
80 if prog: |
|
81 args_list[0] = prog |
|
82 args = patchArguments( |
|
83 _debugClient, |
|
84 args_list, |
|
85 noRedirect=True, |
|
86 isPythonProg=isPythonProg, |
|
87 ) |
|
88 if "shell" in kwargs and kwargs["shell"] is True: |
|
89 args = shlex.join(args) |
74 |
90 |
75 super().__init__(args, *popenargs, **kwargs) |
91 super().__init__(args, *popenargs, **kwargs) |
76 |
92 |
77 _debugClient = debugClient |
93 _debugClient = debugClient |
78 module.Popen = PopenWrapper |
94 module.Popen = PopenWrapper |