diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-09-26 21:34:54 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-09-26 21:34:54 (GMT) |
commit | 081bbf6b28868774c1abca0a8469a517abb9f6cc (patch) | |
tree | 5a91ca676029cceeda75c4a73d2afe77696b4301 /Lib/test/inspect_fodder2.py | |
parent | 2c0a91606105e1606d886c198ea7ed1b195c692f (diff) | |
download | cpython-081bbf6b28868774c1abca0a8469a517abb9f6cc.zip cpython-081bbf6b28868774c1abca0a8469a517abb9f6cc.tar.gz cpython-081bbf6b28868774c1abca0a8469a517abb9f6cc.tar.bz2 |
inspect: Fix getsource() to support decorated functions.
Issue #1764286. Patch by Claudiu Popa.
Diffstat (limited to 'Lib/test/inspect_fodder2.py')
-rw-r--r-- | Lib/test/inspect_fodder2.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/inspect_fodder2.py b/Lib/test/inspect_fodder2.py index bd7106f..e452235 100644 --- a/Lib/test/inspect_fodder2.py +++ b/Lib/test/inspect_fodder2.py @@ -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 |