mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix module debugging in a new process (PY-17885)
We should change interpreter flag '-m' to debugger parameter '--module' in order to debug python modules
This commit is contained in:
@@ -114,17 +114,21 @@ def patch_args(args):
|
||||
return args
|
||||
|
||||
i = 1
|
||||
original = sys.original_argv[:]
|
||||
while i < len(args):
|
||||
if args[i].startswith('-'):
|
||||
new_args.append(args[i])
|
||||
if args[i] == '-m':
|
||||
original.insert(i, '--module')
|
||||
else:
|
||||
break
|
||||
if args[i].startswith('-'):
|
||||
new_args.append(args[i])
|
||||
else:
|
||||
break
|
||||
i += 1
|
||||
|
||||
if i < len(args) and _is_managed_arg(args[i]): # no need to add pydevd twice
|
||||
return args
|
||||
|
||||
for x in sys.original_argv:
|
||||
for x in original:
|
||||
if sys.platform == "win32" and not x.endswith('"'):
|
||||
arg = '"%s"' % x
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user