Fix multiprocess debug for Python 3.3 on Windows (PY-8258).

This commit is contained in:
Dmitry Trofimov
2013-09-24 18:11:41 +02:00
parent 847ae9e657
commit ee2dbfc974
2 changed files with 10 additions and 2 deletions
@@ -32,6 +32,9 @@ def getModuleName(prefix, cnt):
return prefix + "%" + str(cnt)
def insert_to_sys_path(script_path):
print(script_path)
for s in sys.path:
print(s)
while script_path in sys.path:
sys.path.remove(script_path)
sys.path.insert(0, script_path)
+7 -2
View File
@@ -27,12 +27,17 @@ def patch_args(args):
return args
if is_python(args[0]):
if '-c' == args[1]:
try:
indC = args.index('-c')
except KeyError:
indC = -1
if indC != -1:
import pydevd
host, port = pydevd.dispatch()
if port is not None:
args[2] = "import sys; sys.path.append('%s'); import pydevd; pydevd.settrace(host='%s', port=%s, suspend=False); %s"%(helpers, host, port, args[2])
args[indC + 1] = "import sys; sys.path.append('%s'); import pydevd; pydevd.settrace(host='%s', port=%s, suspend=False); %s"%(helpers, host, port, args[indC + 1])
return args
else:
new_args.append(args[0])