From cab75e3e1e4df9ac8ffc1753e3c06cf1b3688e35 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 6 Nov 2013 22:38:37 +0100 Subject: [PATCH] Issue #19512: PRINT_EXPR bytecode now uses an identifier to get sys.displayhook to only create the "displayhook" string once --- Python/ceval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index d4d8466e25d..e2e882be75a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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,