eric7/DebugClients/Python/SubprocessExtension.py

branch
eric7
changeset 8921
8459c7e1b904
parent 8881
54e42bc2437a
equal deleted inserted replaced
8920:fe16c3cf165d 8921:8459c7e1b904
9 """ 9 """
10 10
11 import os 11 import os
12 import shlex 12 import shlex
13 13
14 from DebugUtilities import isPythonProgram, patchArguments 14 from DebugUtilities import (
15 isPythonProgram, patchArguments, stringToArgumentsWindows,
16 isWindowsPlatform
17 )
15 18
16 _debugClient = None 19 _debugClient = None
17 20
18 21
19 def patchSubprocess(module, debugClient): 22 def patchSubprocess(module, debugClient):
47 _debugClient.multiprocessSupport and 50 _debugClient.multiprocessSupport and
48 isinstance(arguments, (str, list)) 51 isinstance(arguments, (str, list))
49 ): 52 ):
50 if isinstance(arguments, str): 53 if isinstance(arguments, str):
51 # convert to arguments list 54 # convert to arguments list
52 arguments = shlex.split(arguments) 55 arguments = (
56 stringToArgumentsWindows(arguments)
57 if isWindowsPlatform() else
58 shlex.split(arguments)
59 )
53 else: 60 else:
54 # create a copy of the arguments 61 # create a copy of the arguments
55 arguments = arguments[:] 62 arguments = arguments[:]
56 ok = isPythonProgram(arguments[0]) 63 ok = isPythonProgram(arguments[0])
57 if ok: 64 if ok:

eric ide

mercurial