diff options
| author | Benjamin Peterson <benjamin@python.org> | 2013-05-15 03:31:26 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2013-05-15 03:31:26 (GMT) |
| commit | e1b4cbc422efc2cc6c5bbbf26645dbb5c001cb49 (patch) | |
| tree | 532371b6a46fa021141c9be584dcfab109c3114f /Lib/test/test_super.py | |
| parent | d486707d2e36f3141da3a3845066e7dabfd94198 (diff) | |
| download | cpython-e1b4cbc422efc2cc6c5bbbf26645dbb5c001cb49.zip cpython-e1b4cbc422efc2cc6c5bbbf26645dbb5c001cb49.tar.gz cpython-e1b4cbc422efc2cc6c5bbbf26645dbb5c001cb49.tar.bz2 | |
when arguments are cells clear the locals slot (backport of #17927)
Diffstat (limited to 'Lib/test/test_super.py')
| -rw-r--r-- | Lib/test/test_super.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py index f6469cf..1e272ee 100644 --- 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_cell_as_self(self): + class X: + def meth(self): + super() + + def f(): + k = X() + def g(): + return k + return g + c = f().__closure__[0] + self.assertRaises(TypeError, X.meth, c) + def test_main(): support.run_unittest(TestSuper) |
