mirror of
https://github.com/python/cpython
synced 2026-10-30 08:11:56 +03:00
[3.14] gh-152132: Fix Py_RunMain() to return an exit code (#153446) (#153455) gh-152132: Fix Py_RunMain() to return an exit code (#153446) * Fix Py_RunMain() to return an exit code, rather than calling Py_Exit(), when running a script, a command, or the REPL. * _PyRun_SimpleFile() now logs errors to stderr, for example if setting __main__.__file__ fails. * Add tests on Py_RunMain() exitcode. * Rename functions: * _PyRun_SimpleStringFlagsWithName() => _PyRun_SimpleString() * _PyRun_SimpleFileObject() => _PyRun_SimpleFile() * _PyRun_AnyFileObject() => _PyRun_AnyFile() * _PyRun_InteractiveLoopObject() => _PyRun_InteractiveLoop() * Change _PyRun_SimpleString(), _PyRun_SimpleFile(), _PyRun_AnyFile() and _PyRun_InteractiveLoop() return type to PyObject*. * pymain_repl() now displays the error if PySys_Audit() or import _pyrepl failed. * PyRun_SimpleFileExFlags() and PyRun_AnyFileExFlags() now log PyUnicode_DecodeFSDefault() error. So these functions can no longer return -1 with an exception set. (cherry picked from commit |
||
|---|---|---|
| .. | ||
| _bootstrap_python.c | ||
| _freeze_module.c | ||
| _freeze_module.py | ||
| _testembed.c | ||
| freeze_test_frozenmain.py | ||
| python.c | ||
| README | ||
| test_frozenmain.h | ||
| test_frozenmain.py | ||
Source files for binary executables (as opposed to shared modules)