gh-83035: handle decorator with nested parens in inspect.getsource (#99654)

This commit is contained in:
Carl Meyer 2022-12-07 09:55:12 -07:00 committed by GitHub
parent b11a384dc7
commit 68e41295b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 9 deletions

View file

@ -886,6 +886,12 @@ class TestNoEOL(GetSourceBase):
self.assertSourceEqual(self.fodderModule.X, 1, 2)
class TestComplexDecorator(GetSourceBase):
fodderModule = mod2
def test_parens_in_decorator(self):
self.assertSourceEqual(self.fodderModule.complex_decorated, 273, 275)
class _BrokenDataDescriptor(object):
"""
A broken data descriptor. See bug #1785.