gh-103978: avoid using 'class' as an identifier (#103979)
https://github.com/python/cpython/commit/ebf97c50f25d61e15671a4658f5718f214c... commit: ebf97c50f25d61e15671a4658f5718f214c35a98 branch: main author: Carl Meyer <carl@oddbird.net> committer: carljm <carl@oddbird.net> date: 2023-04-28T19:20:50Z summary: gh-103978: avoid using 'class' as an identifier (#103979) files: M Include/internal/pycore_code.h M Python/specialize.c diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index 7d5d5e03de9e..86fd48b63ef8 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -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); diff --git a/Python/specialize.c b/Python/specialize.c index 33a3c4561c7c..fbdb435082ce 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -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);
participants (1)
-
carljm