From 5f55067e238c21de25f09ece9bb24ae8c42d02b4 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 16 Nov 2022 09:37:14 -0700 Subject: gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516) https://github.com/python/cpython/issues/81057 --- Python/pythonrun.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 1c7ac4af63..eead707b54 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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; } -- cgit v1.2.1