inspect: Fix getsource() to support decorated functions.

Issue #1764286. Patch by Claudiu Popa.
This commit is contained in:
Yury Selivanov 2014-09-26 17:34:54 -04:00
parent 2c0a916061
commit 081bbf6b28
4 changed files with 20 additions and 0 deletions

View file

@ -109,3 +109,16 @@ def annotated(arg1: list):
#line 109
def keyword_only_arg(*, arg):
pass
from functools import wraps
def decorator(func):
@wraps(func)
def fake():
return 42
return fake
#line 121
@decorator
def real():
return 20