mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
IDEA-CR-56419: PY-34555 Clean module flag for child process
If a process was started with `-m` key (and converted to `--module` flag), this parameter will be passed to all its child processes. So we need to clear this flag in SetupHolder before patching arguments GitOrigin-RevId: 00ae0b23fc6107bee75272a03a5bd15ca474fbc7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a0ee74c04e
commit
5c67bc0373
@@ -228,6 +228,7 @@ def patch_args(args):
|
||||
# ['X:\\pysrc\\pydevd.py', '--multiprocess', '--print-in-debugger-startup',
|
||||
# '--vm_type', 'python', '--client', '127.0.0.1', '--port', '56352', '--file', 'x:\\snippet1.py']
|
||||
from _pydevd_bundle.pydevd_command_line_handling import setup_to_argv
|
||||
SetupHolder.setup['module'] = False # clean module param from parent process
|
||||
original = setup_to_argv(SetupHolder.setup) + ['--file']
|
||||
while i < len(args):
|
||||
if args[i] == '-m':
|
||||
|
||||
8
python/testData/debug/test_subprocess_module.py
Normal file
8
python/testData/debug/test_subprocess_module.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
ret = subprocess.call([os.path.abspath(sys.executable), "-m", "test_subprocess"])
|
||||
|
||||
print("Module returned code %d" % ret)
|
||||
@@ -194,4 +194,23 @@ public class PythonDebuggerMultiprocessingTest extends PyEnvTestCase {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubprocessModule() {
|
||||
runPythonTest(new PyDebuggerMultiprocessTask("/debug", "test_subprocess_module.py") {
|
||||
@Override
|
||||
public void before() {
|
||||
toggleBreakpoint(getFilePath("test_python_subprocess_another_helper.py"), 2);
|
||||
setWaitForTermination(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testing() throws Exception {
|
||||
waitForPause();
|
||||
eval("x").hasValue("42");
|
||||
resume();
|
||||
waitForOutput("Module returned code 0");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user