mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
inspect: Fix getsource() to support decorated functions.
Issue #1764286. Patch by Claudiu Popa.
This commit is contained in:
parent
2c0a916061
commit
081bbf6b28
4 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue