]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103978: avoid using 'class' as an identifier (#103979)
authorCarl Meyer <carl@oddbird.net>
Fri, 28 Apr 2023 19:20:50 +0000 (13:20 -0600)
committerGitHub <noreply@github.com>
Fri, 28 Apr 2023 19:20:50 +0000 (19:20 +0000)
Include/internal/pycore_code.h
Python/specialize.c

index 7d5d5e03de9e410b4ce91aa61e239255af34116e..86fd48b63ef8e408727425fa12a45b61bc01cb58 100644 (file)
@@ -226,7 +226,7 @@ extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range);
 
 /* Specialization functions */
 
-extern void _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *self,
+extern void _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *cls, PyObject *self,
                                          _Py_CODEUNIT *instr, PyObject *name, int load_method);
 extern void _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr,
                                     PyObject *name);
index 33a3c4561c7ca29b1869c0cd540ada4897ab9a39..fbdb435082cece70ae40e90cb40fd096ef668911 100644 (file)
@@ -515,7 +515,7 @@ specialize_module_load_attr(
 /* Attribute specialization */
 
 void
-_Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *self,
+_Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *cls, PyObject *self,
                              _Py_CODEUNIT *instr, PyObject *name, int load_method) {
     assert(ENABLE_SPECIALIZATION);
     assert(_PyOpcode_Caches[LOAD_SUPER_ATTR] == INLINE_CACHE_ENTRIES_LOAD_SUPER_ATTR);
@@ -528,11 +528,11 @@ _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *
         SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_SHADOWED);
         goto fail;
     }
-    if (!PyType_Check(class)) {
+    if (!PyType_Check(cls)) {
         SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_BAD_CLASS);
         goto fail;
     }
-    PyTypeObject *tp = (PyTypeObject *)class;
+    PyTypeObject *tp = (PyTypeObject *)cls;
     PyObject *res = _PySuper_LookupDescr(tp, self, name);
     if (res == NULL) {
         SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_ERROR_OR_NOT_FOUND);