cpython: 2b4b289c1abb (original) (raw)

Mercurial > cpython

changeset 83772:2b4b289c1abb 3.3

when arguments are cells clear the locals slot (backport of #17927) [#17927]

Benjamin Peterson benjamin@python.org
date Tue, 14 May 2013 22:31:26 -0500
parents e2288953e9f1
children bb8093e427f9 2bc63e65b3bf
files Lib/test/test_scope.py Lib/test/test_super.py Misc/NEWS Objects/typeobject.c Python/ceval.c
diffstat 5 files changed, 63 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_scope.py 29 Lib/test/test_super.py 13 Misc/NEWS 3 Objects/typeobject.c 12 Python/ceval.c 8

line wrap: on

line diff

--- a/Lib/test/test_scope.py +++ b/Lib/test/test_scope.py @@ -1,4 +1,6 @@ import unittest +import weakref + from test.support import check_syntax_error, cpython_only, run_unittest @@ -713,6 +715,33 @@ class ScopeTests(unittest.TestCase): def b(): global a

def test_main():

--- a/Lib/test/test_super.py +++ b/Lib/test/test_super.py @@ -130,6 +130,19 @@ class TestSuper(unittest.TestCase): super() self.assertRaises(RuntimeError, X().f)

+

+ def test_main(): support.run_unittest(TestSuper)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,9 @@ What's New in Python 3.3.2? Core and Builtins ----------------- +- Issue #17927: Frame objects kept arguments alive if they had been copied into

--- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6519,6 +6519,18 @@ super_init(PyObject *self, PyObject *arg return -1; } obj = f->f_localsplus[0];

--- a/Python/ceval.c +++ b/Python/ceval.c @@ -3403,10 +3403,14 @@ PyEval_EvalCodeEx(PyObject _co, PyObjec int arg; / Possibly account for the cell variable being an argument. */ if (co->co_cell2arg != NULL &&