summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-06 21:38:37 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-06 21:38:37 (GMT)
commitcab75e3e1e4df9ac8ffc1753e3c06cf1b3688e35 (patch)
treebee22f3cf267abd255df2eaad7ecc05620d1983a /Python
parentd67bd45537856a097d807e2b781fcaf60c68b89f (diff)
downloadcpython-cab75e3e1e4df9ac8ffc1753e3c06cf1b3688e35.zip
cpython-cab75e3e1e4df9ac8ffc1753e3c06cf1b3688e35.tar.gz
cpython-cab75e3e1e4df9ac8ffc1753e3c06cf1b3688e35.tar.bz2
Issue #19512: PRINT_EXPR bytecode now uses an identifier to get sys.displayhook
to only create the "displayhook" string once
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index d4d8466..e2e882b 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,