bpo-42116: Fix inspect.getsource handling of trailing comments (GH-23630)

This commit is contained in:
Irit Katriel 2020-12-04 16:45:38 +00:00 committed by GitHub
parent 066394018a
commit 6e1eec71f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 4 deletions

View file

@ -91,3 +91,25 @@ class Callable:
custom_method = Callable().as_method_of(42)
del Callable
# line 95
class WhichComments:
# line 97
# before f
def f(self):
# line 100
# start f
return 1
# line 103
# end f
# line 105
# after f
# before asyncf - line 108
async def asyncf(self):
# start asyncf
return 2
# end asyncf
# after asyncf - line 113
# end of WhichComments - line 114
# after WhichComments - line 115