Commit a5df60ac authored by Victor Stinner's avatar Victor Stinner

Issue #19512: PRINT_EXPR bytecode now uses an identifier to get sys.displayhook

to only create the "displayhook" string once
parent 667ec68f
......@@ -1840,8 +1840,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
}
TARGET(PRINT_EXPR) {
_Py_IDENTIFIER(displayhook);
PyObject *value = POP();
PyObject *hook = PySys_GetObject("displayhook");
PyObject *hook = _PySys_GetObjectId(&PyId_displayhook);
PyObject *res;
if (hook == NULL) {
PyErr_SetString(PyExc_RuntimeError,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment