mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
gh-103978: avoid using 'class' as an identifier (#103979)
This commit is contained in:
parent
83aa496f81
commit
ebf97c50f2
2 changed files with 4 additions and 4 deletions
|
@ -226,7 +226,7 @@ extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range);
|
||||||
|
|
||||||
/* Specialization functions */
|
/* 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);
|
_Py_CODEUNIT *instr, PyObject *name, int load_method);
|
||||||
extern void _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr,
|
extern void _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr,
|
||||||
PyObject *name);
|
PyObject *name);
|
||||||
|
|
|
@ -515,7 +515,7 @@ specialize_module_load_attr(
|
||||||
/* Attribute specialization */
|
/* Attribute specialization */
|
||||||
|
|
||||||
void
|
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) {
|
_Py_CODEUNIT *instr, PyObject *name, int load_method) {
|
||||||
assert(ENABLE_SPECIALIZATION);
|
assert(ENABLE_SPECIALIZATION);
|
||||||
assert(_PyOpcode_Caches[LOAD_SUPER_ATTR] == INLINE_CACHE_ENTRIES_LOAD_SUPER_ATTR);
|
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);
|
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_SHADOWED);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (!PyType_Check(class)) {
|
if (!PyType_Check(cls)) {
|
||||||
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_BAD_CLASS);
|
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_BAD_CLASS);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
PyTypeObject *tp = (PyTypeObject *)class;
|
PyTypeObject *tp = (PyTypeObject *)cls;
|
||||||
PyObject *res = _PySuper_LookupDescr(tp, self, name);
|
PyObject *res = _PySuper_LookupDescr(tp, self, name);
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_ERROR_OR_NOT_FOUND);
|
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_ERROR_OR_NOT_FOUND);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue