summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-01-30 17:20:25 -0600
committerGitHub <noreply@github.com>2020-01-30 15:20:25 -0800
commit46874c26ee1fc752e2e6930efa1d223b2351edb8 (patch)
treeb4c85470214ac73ec6e4fa9981bb1f0e7b46472e /Python/ceval.c
parentc232c9110cfefa0935cbf158e35e91746a8a9361 (diff)
downloadcpython-git-46874c26ee1fc752e2e6930efa1d223b2351edb8.tar.gz
bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code (GH-18254)
Moving repetitive `_Py_IDENTIFIER` instances to a global location helps identify them more easily in regards to sub-interpreter support.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 2bf64eda42..892d668816 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -39,6 +39,7 @@
# error "ceval.c must be build with Py_BUILD_CORE define for best performance"
#endif
+_Py_IDENTIFIER(__name__);
/* Forward declarations */
Py_LOCAL_INLINE(PyObject *) call_function(
@@ -5032,7 +5033,6 @@ static PyObject *
import_from(PyThreadState *tstate, PyObject *v, PyObject *name)
{
PyObject *x;
- _Py_IDENTIFIER(__name__);
PyObject *fullmodname, *pkgname, *pkgpath, *pkgname_or_unknown, *errmsg;
if (_PyObject_LookupAttr(v, name, &x) != 0) {
@@ -5108,7 +5108,6 @@ import_all_from(PyThreadState *tstate, PyObject *locals, PyObject *v)
{
_Py_IDENTIFIER(__all__);
_Py_IDENTIFIER(__dict__);
- _Py_IDENTIFIER(__name__);
PyObject *all, *dict, *name, *value;
int skip_leading_underscores = 0;
int pos, err;