mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #21217: inspect.getsourcelines() now tries to compute the start and
end lines from the code object, fixing an issue when a lambda function is used as decorator argument. Patch by Thomas Ballinger.
This commit is contained in:
parent
97100c0e3d
commit
a8723a02ea
5 changed files with 49 additions and 17 deletions
|
|
@ -110,6 +110,14 @@ def annotated(arg1: list):
|
|||
def keyword_only_arg(*, arg):
|
||||
pass
|
||||
|
||||
@wrap(lambda: None)
|
||||
def func114():
|
||||
return 115
|
||||
|
||||
class ClassWithMethod:
|
||||
def method(self):
|
||||
pass
|
||||
|
||||
from functools import wraps
|
||||
|
||||
def decorator(func):
|
||||
|
|
@ -118,7 +126,7 @@ def decorator(func):
|
|||
return 42
|
||||
return fake
|
||||
|
||||
#line 121
|
||||
#line 129
|
||||
@decorator
|
||||
def real():
|
||||
return 20
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue