mirror of
https://github.com/python/cpython.git
synced 2025-07-08 20:05:28 +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
|
@ -1688,7 +1688,8 @@ run_eval_code_obj(PyThreadState *tstate, PyCodeObject *co, PyObject *globals, Py
|
|||
* uncaught exception to trigger an unexplained signal exit from a future
|
||||
* Py_Main() based one.
|
||||
*/
|
||||
_Py_UnhandledKeyboardInterrupt = 0;
|
||||
// XXX Isn't this dealt with by the move to _PyRuntimeState?
|
||||
_PyRuntime.signals.unhandled_keyboard_interrupt = 0;
|
||||
|
||||
/* Set globals['__builtins__'] if it doesn't exist */
|
||||
if (globals != NULL && _PyDict_GetItemStringWithError(globals, "__builtins__") == NULL) {
|
||||
|
@ -1702,7 +1703,7 @@ run_eval_code_obj(PyThreadState *tstate, PyCodeObject *co, PyObject *globals, Py
|
|||
|
||||
v = PyEval_EvalCode((PyObject*)co, globals, locals);
|
||||
if (!v && _PyErr_Occurred(tstate) == PyExc_KeyboardInterrupt) {
|
||||
_Py_UnhandledKeyboardInterrupt = 1;
|
||||
_PyRuntime.signals.unhandled_keyboard_interrupt = 1;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue