summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-06 21:41:44 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-06 21:41:44 (GMT)
commit090543736fa86c676252de7a44e6a7c6f347164e (patch)
treeca82d3bf4857aa474ba91d81c64cc946a22d31a0 /Python/bltinmodule.c
parentbb52020d44b6f3f1ebd16ec6ce38f1f8a6330728 (diff)
downloadcpython-090543736fa86c676252de7a44e6a7c6f347164e.zip
cpython-090543736fa86c676252de7a44e6a7c6f347164e.tar.gz
cpython-090543736fa86c676252de7a44e6a7c6f347164e.tar.bz2
Issue #19512: add some common identifiers to only create common strings once,
instead of creating temporary Unicode string objects Add also more identifiers in pythonrun.c to avoid temporary Unicode string objets for the interactive interpreter.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 6069e41..6eb0ee7 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1553,7 +1553,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
kwlist, &sep, &end, &file, &flush))
return NULL;
if (file == NULL || file == Py_None) {
- file = PySys_GetObject("stdout");
+ file = _PySys_GetObjectId(&_PyId_stdout);
if (file == NULL) {
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
return NULL;
@@ -1638,9 +1638,9 @@ static PyObject *
builtin_input(PyObject *self, PyObject *args)
{
PyObject *promptarg = NULL;
- PyObject *fin = PySys_GetObject("stdin");
- PyObject *fout = PySys_GetObject("stdout");
- PyObject *ferr = PySys_GetObject("stderr");
+ PyObject *fin = _PySys_GetObjectId(&_PyId_stdin);
+ PyObject *fout = _PySys_GetObjectId(&_PyId_stdout);
+ PyObject *ferr = _PySys_GetObjectId(&_PyId_stderr);
PyObject *tmp;
long fd;
int tty;