mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)
https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
5cfb7d19f5
commit
5f55067e23
24 changed files with 241 additions and 130 deletions
|
@ -296,10 +296,10 @@ pymain_run_module(const wchar_t *modname, int set_argv0)
|
|||
Py_DECREF(module);
|
||||
return pymain_exit_err_print();
|
||||
}
|
||||
_Py_UnhandledKeyboardInterrupt = 0;
|
||||
_PyRuntime.signals.unhandled_keyboard_interrupt = 0;
|
||||
result = PyObject_Call(runmodule, runargs, NULL);
|
||||
if (!result && PyErr_Occurred() == PyExc_KeyboardInterrupt) {
|
||||
_Py_UnhandledKeyboardInterrupt = 1;
|
||||
_PyRuntime.signals.unhandled_keyboard_interrupt = 1;
|
||||
}
|
||||
Py_DECREF(runpy);
|
||||
Py_DECREF(runmodule);
|
||||
|
@ -696,7 +696,7 @@ Py_RunMain(void)
|
|||
|
||||
pymain_free();
|
||||
|
||||
if (_Py_UnhandledKeyboardInterrupt) {
|
||||
if (_PyRuntime.signals.unhandled_keyboard_interrupt) {
|
||||
exitcode = exit_sigint();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue