src/eric7/DebugClients/Python/MultiProcessDebugExtension.py

branch
eric7-maintenance
changeset 9654
7328efba128b
parent 9653
e67609152c5e
child 10119
64147a7e6393
equal deleted inserted replaced
9555:88f10deec960 9654:7328efba128b
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 2
3 # Copyright (c) 2002 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2002 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing a function to patch the process creation functions to 7 Module implementing a function to patch the process creation functions to
8 support multiprocess debugging. 8 support multiprocess debugging.
69 69
70 def newExecl(path, *args): 70 def newExecl(path, *args):
71 """ 71 """
72 Function replacing the 'execl' functions of the os module. 72 Function replacing the 'execl' functions of the os module.
73 """ 73 """
74 if _shallPatch(): 74 if _shallPatch() and isPythonProgram(args[0]):
75 args = patchArguments(_debugClient, args) 75 args = patchArguments(_debugClient, args)
76 if isPythonProgram(args[0]): 76 path = args[0]
77 path = args[0]
78 return getattr(os, originalName)(path, *args) 77 return getattr(os, originalName)(path, *args)
79 78
80 return newExecl 79 return newExecl
81 80
82 81
97 96
98 def newExecv(path, args): 97 def newExecv(path, args):
99 """ 98 """
100 Function replacing the 'execv' functions of the os module. 99 Function replacing the 'execv' functions of the os module.
101 """ 100 """
102 if _shallPatch(): 101 if _shallPatch() and isPythonProgram(args[0]):
103 args = patchArguments(_debugClient, args) 102 args = patchArguments(_debugClient, args)
104 if isPythonProgram(args[0]): 103 path = args[0]
105 path = args[0]
106 return getattr(os, originalName)(path, args) 104 return getattr(os, originalName)(path, args)
107 105
108 return newExecv 106 return newExecv
109 107
110 108
125 123
126 def newExecve(path, args, env): 124 def newExecve(path, args, env):
127 """ 125 """
128 Function replacing the 'execve' functions of the os module. 126 Function replacing the 'execve' functions of the os module.
129 """ 127 """
130 if _shallPatch(): 128 if _shallPatch() and isPythonProgram(args[0]):
131 args = patchArguments(_debugClient, args) 129 args = patchArguments(_debugClient, args)
132 if isPythonProgram(args[0]): 130 path = args[0]
133 path = args[0]
134 return getattr(os, originalName)(path, args, env) 131 return getattr(os, originalName)(path, args, env)
135 132
136 return newExecve 133 return newExecve
137 134
138 135

eric ide

mercurial