summaryrefslogtreecommitdiffstats
path: root/Lib/test/inspect_fodder2.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-09-26 21:34:54 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-09-26 21:34:54 (GMT)
commit081bbf6b28868774c1abca0a8469a517abb9f6cc (patch)
tree5a91ca676029cceeda75c4a73d2afe77696b4301 /Lib/test/inspect_fodder2.py
parent2c0a91606105e1606d886c198ea7ed1b195c692f (diff)
downloadcpython-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.py13
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