Repository navigation
Conversation
Fixes gotcha#278 Signed-off-by: Mark Colley <39366189+M-Colley@users.noreply.github.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Fixes gotcha#278 Signed-off-by: Mark Colley <39366189+M-Colley@users.noreply.github.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Calling
set_trace()whensys.argvis empty raisesIndexErrorinsideargparse.ArgumentParser. Specifically,_get_debugger_cls()callsTerminalIPythonApp.initialize(["--no-term-title"]), which readssys.argv[0]by default. Fixes #278.To prevent this crash,
_get_debugger_cls()setssys.argvto[""]duringipapp.initialize(["--no-term-title"])whensys.argvis empty and restores the original list in afinallyblock. In addition,DebuggerClsTest.test_empty_sys_argvintests/test_opts.pyverifies that_get_debugger_cls()succeeds and preservessys.argv.Verified with
pytest tests -o addopts= -W default -v(20 passed, 2 skipped).Summary by CodeRabbit