diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 18:03:11 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 18:03:11 (GMT) |
commit | b44562b6b90c4974ac11aae2caec227295679363 (patch) | |
tree | c2dc54bdbc47d3502ba9583aeb4ed1def151335f /Python/bltinmodule.c | |
parent | 3688aa9a0417b5fbe94510da4a078c3ac3c481e0 (diff) | |
download | cpython-b44562b6b90c4974ac11aae2caec227295679363.zip cpython-b44562b6b90c4974ac11aae2caec227295679363.tar.gz cpython-b44562b6b90c4974ac11aae2caec227295679363.tar.bz2 |
Issue #19512: eval() and exec() now use an identifier for "__builtins__" string
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index b0be671..6069e41 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -34,6 +34,7 @@ int Py_HasFileSystemDefaultEncoding = 0; _Py_IDENTIFIER(fileno); _Py_IDENTIFIER(flush); +_Py_IDENTIFIER(__builtins__); static PyObject * builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) @@ -771,9 +772,9 @@ builtin_eval(PyObject *self, PyObject *args) return NULL; } - if (PyDict_GetItemString(globals, "__builtins__") == NULL) { - if (PyDict_SetItemString(globals, "__builtins__", - PyEval_GetBuiltins()) != 0) + if (_PyDict_GetItemId(globals, &PyId___builtins__) == NULL) { + if (_PyDict_SetItemId(globals, &PyId___builtins__, + PyEval_GetBuiltins()) != 0) return NULL; } @@ -846,9 +847,9 @@ builtin_exec(PyObject *self, PyObject *args) locals->ob_type->tp_name); return NULL; } - if (PyDict_GetItemString(globals, "__builtins__") == NULL) { - if (PyDict_SetItemString(globals, "__builtins__", - PyEval_GetBuiltins()) != 0) + if (_PyDict_GetItemId(globals, &PyId___builtins__) == NULL) { + if (_PyDict_SetItemId(globals, &PyId___builtins__, + PyEval_GetBuiltins()) != 0) return NULL; } |