mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix for bug 4360 "SystemError when method has both super() & closure". Patch
by amaury.forgeotdarc and reviewed by brett.cannon. Also add release notes about the known problems with the email package.
This commit is contained in:
parent
2d1ca2dbab
commit
91cc8fb92b
3 changed files with 21 additions and 2 deletions
|
@ -6170,8 +6170,9 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
assert(PyUnicode_Check(name));
|
||||
if (!PyUnicode_CompareWithASCIIString(name,
|
||||
"__class__")) {
|
||||
PyObject *cell =
|
||||
f->f_localsplus[co->co_nlocals + i];
|
||||
Py_ssize_t index = co->co_nlocals +
|
||||
PyTuple_GET_SIZE(co->co_cellvars) + i;
|
||||
PyObject *cell = f->f_localsplus[index];
|
||||
if (cell == NULL || !PyCell_Check(cell)) {
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"super(): bad __class__ cell");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue