summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2008-11-20 20:01:57 (GMT)
committerBarry Warsaw <barry@python.org>2008-11-20 20:01:57 (GMT)
commit91cc8fb92b5d59d26cfca0167b32f6f25b453849 (patch)
tree4d63b6dcf6ffb33332ccad8cdb1a4d5fcb1459f6 /Objects
parent2d1ca2dbabde2ed69e06b50ddb2e87b12958d696 (diff)
downloadcpython-91cc8fb92b5d59d26cfca0167b32f6f25b453849.zip
cpython-91cc8fb92b5d59d26cfca0167b32f6f25b453849.tar.gz
cpython-91cc8fb92b5d59d26cfca0167b32f6f25b453849.tar.bz2
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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 7f9a26d..b6ffe92 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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");