mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +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
|
@ -70,6 +70,17 @@ class TestSuper(unittest.TestCase):
|
|||
e = E()
|
||||
self.assertEqual(e.cm(), (e, (E, (E, (E, 'A'), 'B'), 'C'), 'D'))
|
||||
|
||||
def testSuperWithClosure(self):
|
||||
# Issue4360: super() did not work in a function that
|
||||
# contains a closure
|
||||
class E(A):
|
||||
def f(self):
|
||||
def nested():
|
||||
self
|
||||
return super().f() + 'E'
|
||||
|
||||
self.assertEqual(E().f(), 'AE')
|
||||
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(TestSuper)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue