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

(cherry picked from commit 68e41295b8)

Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
Miss Islington (bot) 2022-12-07 09:26:11 -08:00 committed by GitHub
parent 2b97ddd512
commit 2997f3913a
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.