summaryrefslogtreecommitdiffstats
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-01-30 23:20:25 (GMT)
committerGitHub <noreply@github.com>2020-01-30 23:20:25 (GMT)
commit46874c26ee1fc752e2e6930efa1d223b2351edb8 (patch)
treeb4c85470214ac73ec6e4fa9981bb1f0e7b46472e /Objects/typeobject.c
parentc232c9110cfefa0935cbf158e35e91746a8a9361 (diff)
downloadcpython-46874c26ee1fc752e2e6930efa1d223b2351edb8.zip
cpython-46874c26ee1fc752e2e6930efa1d223b2351edb8.tar.gz
cpython-46874c26ee1fc752e2e6930efa1d223b2351edb8.tar.bz2
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 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 8422a3c..01def83 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -74,6 +74,7 @@ _Py_IDENTIFIER(__new__);
_Py_IDENTIFIER(__set_name__);
_Py_IDENTIFIER(__setitem__);
_Py_IDENTIFIER(builtins);
+_Py_IDENTIFIER(mro);
static PyObject *
slot_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
@@ -310,7 +311,6 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) {
return;
if (custom) {
- _Py_IDENTIFIER(mro);
mro_meth = lookup_maybe_method(
(PyObject *)type, &PyId_mro, &unbound);
if (mro_meth == NULL)
@@ -1891,7 +1891,6 @@ mro_invoke(PyTypeObject *type)
int custom = (Py_TYPE(type) != &PyType_Type);
if (custom) {
- _Py_IDENTIFIER(mro);
int unbound;
PyObject *mro_meth = lookup_method((PyObject *)type, &PyId_mro,
&unbound);