mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Issue #19512: PRINT_EXPR bytecode now uses an identifier to get sys.displayhook
to only create the "displayhook" string once
This commit is contained in:
parent
d67bd45537
commit
cab75e3e1e
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue