mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Patch #1159931/bug #1143895: inspect.getsource failed when functions,
etc., had comments after the colon, and some other cases. This patch take a simpler approach that doesn't rely on looking for a ':'. Thanks Simon Percivall!
This commit is contained in:
parent
f77d0334f3
commit
a5855d5ace
3 changed files with 26 additions and 5 deletions
|
@ -53,3 +53,14 @@ a = [None,
|
|||
def setfunc(func):
|
||||
globals()["anonymous"] = func
|
||||
setfunc(lambda x, y: x*y)
|
||||
|
||||
# line 57
|
||||
def with_comment(): # hello
|
||||
world
|
||||
|
||||
# line 61
|
||||
multiline_sig = [
|
||||
lambda (x,
|
||||
y): x+y,
|
||||
None,
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue