150 |
150 |
151 def newSpawnl(mode, path, *args): |
151 def newSpawnl(mode, path, *args): |
152 """ |
152 """ |
153 Function replacing the 'spawnl' functions of the os module. |
153 Function replacing the 'spawnl' functions of the os module. |
154 """ |
154 """ |
155 args = patchArguments(_debugClient, args) |
155 if _shallPatch(): |
|
156 args = patchArguments(_debugClient, args) |
156 return getattr(os, originalName)(mode, path, *args) |
157 return getattr(os, originalName)(mode, path, *args) |
157 |
158 |
158 return newSpawnl |
159 return newSpawnl |
159 |
160 |
160 |
161 |
175 |
176 |
176 def newSpawnv(mode, path, args): |
177 def newSpawnv(mode, path, args): |
177 """ |
178 """ |
178 Function replacing the 'spawnv' functions of the os module. |
179 Function replacing the 'spawnv' functions of the os module. |
179 """ |
180 """ |
180 args = patchArguments(_debugClient, args) |
181 if _shallPatch(): |
|
182 args = patchArguments(_debugClient, args) |
181 return getattr(os, originalName)(mode, path, args) |
183 return getattr(os, originalName)(mode, path, args) |
182 |
184 |
183 return newSpawnv |
185 return newSpawnv |
184 |
186 |
185 |
187 |
200 |
202 |
201 def newSpawnve(mode, path, args, env): |
203 def newSpawnve(mode, path, args, env): |
202 """ |
204 """ |
203 Function replacing the 'spawnve' functions of the os module. |
205 Function replacing the 'spawnve' functions of the os module. |
204 """ |
206 """ |
205 args = patchArguments(_debugClient, args) |
207 if _shallPatch(): |
|
208 args = patchArguments(_debugClient, args) |
206 return getattr(os, originalName)(mode, path, args, env) |
209 return getattr(os, originalName)(mode, path, args, env) |
207 |
210 |
208 return newSpawnve |
211 return newSpawnve |
209 |
212 |
210 |
213 |
227 |
230 |
228 def newPosixSpawn(path, argv, env, **kwargs): |
231 def newPosixSpawn(path, argv, env, **kwargs): |
229 """ |
232 """ |
230 Function replacing the 'posix_spawn' functions of the os module. |
233 Function replacing the 'posix_spawn' functions of the os module. |
231 """ |
234 """ |
232 argv = patchArguments(_debugClient, argv) |
235 if _shallPatch(): |
|
236 argv = patchArguments(_debugClient, argv) |
233 return getattr(os, originalName)(path, argv, env, **kwargs) |
237 return getattr(os, originalName)(path, argv, env, **kwargs) |
234 |
238 |
235 return newPosixSpawn |
239 return newPosixSpawn |
236 |
240 |
237 |
241 |
360 """ |
364 """ |
361 try: |
365 try: |
362 import _subprocess # __IGNORE_WARNING_I10__ |
366 import _subprocess # __IGNORE_WARNING_I10__ |
363 except ImportError: |
367 except ImportError: |
364 import _winapi as _subprocess # __IGNORE_WARNING_I10__ |
368 import _winapi as _subprocess # __IGNORE_WARNING_I10__ |
365 return getattr(_subprocess, originalName)( |
369 if _shallPatch(): |
366 appName, patchArgumentStringWindows(_debugClient, cmdline), *args |
370 cmdline = patchArgumentStringWindows(_debugClient, cmdline) |
367 ) |
371 return getattr(_subprocess, originalName)(appName, cmdline, *args) |
368 |
372 |
369 return newCreateProcess |
373 return newCreateProcess |
370 |
374 |
371 |
375 |
372 def patchNewProcessFunctions(multiprocessEnabled, debugClient): |
376 def patchNewProcessFunctions(multiprocessEnabled, debugClient): |