mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-15 05:16:30 +00:00
Fix Python test_repl in MODE=dbg (#412)
This commit is contained in:
parent
de5de19004
commit
909e54510d
2 changed files with 7 additions and 9 deletions
5
third_party/python/Lib/test/test_repl.py
vendored
5
third_party/python/Lib/test/test_repl.py
vendored
|
@ -9,6 +9,9 @@ from textwrap import dedent
|
|||
from test.support import cpython_only, SuppressCrashReport
|
||||
from test.support.script_helper import kill_python
|
||||
|
||||
if __name__ == "PYOBJ.COM":
|
||||
import _testcapi
|
||||
|
||||
def spawn_repl(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
|
||||
"""Run the Python REPL with the given arguments.
|
||||
|
||||
|
@ -22,7 +25,7 @@ def spawn_repl(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
|
|||
# executable for the Popen() call to python to succeed as the directory
|
||||
# path may be used by Py_GetPath() to build the default module search
|
||||
# path.
|
||||
stdin_fname = os.path.join(os.path.dirname(sys.executable), "<stdin>")
|
||||
stdin_fname = sys.executable
|
||||
cmd_line = [stdin_fname, '-E', '-i']
|
||||
cmd_line.extend(args)
|
||||
|
||||
|
|
11
third_party/python/Python/fatality.c
vendored
11
third_party/python/Python/fatality.c
vendored
|
@ -124,14 +124,9 @@ Py_FatalError(const char *msg)
|
|||
}
|
||||
int has_tstate_and_gil = (tss_tstate != NULL);
|
||||
|
||||
if (has_tstate_and_gil) {
|
||||
/* If an exception is set, print the exception with its traceback */
|
||||
if (!_Py_FatalError_PrintExc(fd)) {
|
||||
/* No exception is set, or an exception is set without traceback */
|
||||
_Py_FatalError_DumpTracebacks(fd);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* If an exception is set, print the exception with its traceback */
|
||||
if (!_Py_FatalError_PrintExc(fd)) {
|
||||
/* No exception is set, or an exception is set without traceback */
|
||||
_Py_FatalError_DumpTracebacks(fd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue