Skip to content

Commit ebf97c5

Browse files
authored
gh-103978: avoid using 'class' as an identifier (#103979)
1 parent 83aa496 commit ebf97c5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Include/internal/pycore_code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range);
226226

227227
/* Specialization functions */
228228

229-
extern void _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *self,
229+
extern void _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *cls, PyObject *self,
230230
_Py_CODEUNIT *instr, PyObject *name, int load_method);
231231
extern void _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr,
232232
PyObject *name);

Python/specialize.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ specialize_module_load_attr(
515515
/* Attribute specialization */
516516

517517
void
518-
_Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *self,
518+
_Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *cls, PyObject *self,
519519
_Py_CODEUNIT *instr, PyObject *name, int load_method) {
520520
assert(ENABLE_SPECIALIZATION);
521521
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 *
528528
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_SHADOWED);
529529
goto fail;
530530
}
531-
if (!PyType_Check(class)) {
531+
if (!PyType_Check(cls)) {
532532
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_BAD_CLASS);
533533
goto fail;
534534
}
535-
PyTypeObject *tp = (PyTypeObject *)class;
535+
PyTypeObject *tp = (PyTypeObject *)cls;
536536
PyObject *res = _PySuper_LookupDescr(tp, self, name);
537537
if (res == NULL) {
538538
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_ERROR_OR_NOT_FOUND);

0 commit comments

Comments
 (0)