summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_super.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-05-12 23:16:06 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-05-12 23:16:06 (GMT)
commit159ae41da68ff1f1d85ed66fa6410bd9ba62ed5b (patch)
tree379d3664706b0a0dcc7d32f762d88595ae8e84bf /Lib/test/test_super.py
parent3bfc5f5d833f081089e181cadf52d4ec50e62d13 (diff)
downloadcpython-159ae41da68ff1f1d85ed66fa6410bd9ba62ed5b.zip
cpython-159ae41da68ff1f1d85ed66fa6410bd9ba62ed5b.tar.gz
cpython-159ae41da68ff1f1d85ed66fa6410bd9ba62ed5b.tar.bz2
when an argument is a cell, set the local copy to NULL (see #17927)
Diffstat (limited to 'Lib/test/test_super.py')
-rw-r--r--Lib/test/test_super.py13
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)