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:
Antoine Pitrou 2015-04-15 00:41:29 +02:00
parent 97100c0e3d
commit a8723a02ea
5 changed files with 49 additions and 17 deletions

View file

@ -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