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:
Johannes Gijsbers 2005-03-12 16:37:11 +00:00
parent f77d0334f3
commit a5855d5ace
3 changed files with 26 additions and 5 deletions

View file

@ -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,
]