Message203426
got:
>>> l = {}
>>> import inspect
>>> exec(compile('def fun(): pass', '', 'exec'), l, l)
>>> inspect.getsource(l['fun'])
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/private/.local/lib/python3.3/inspect.py", line 726, in getsource
lines, lnum = getsourcelines(object)
File "/home/private/.local/lib/python3.3/inspect.py", line 715, in getsourcelines
lines, lnum = findsource(object)
File "/home/private/.local/lib/python3.3/inspect.py", line 553, in findsource
if not sourcefile and file[0] + file[-1] != '<>':
IndexError: string index out of range
expected:
>>> l = {}
>>> import inspect
>>> exec(compile('def fun(): pass', '', 'exec'), l, l)
>>> inspect.getsource(l['fun'])
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/private/.local/lib/python3.3/inspect.py", line 726, in getsource
lines, lnum = getsourcelines(object)
File "/home/private/.local/lib/python3.3/inspect.py", line 715, in getsourcelines
lines, lnum = findsource(object)
File "/home/private/.local/lib/python3.3/inspect.py", line 563, in findsource
raise IOError('could not get source code')
OSError: could not get source code
this is a extraction, it appears that python in certein circumstances creates code objects with that setup on its own,
im still further investigating |
|
Date |
User |
Action |
Args |
2013-11-19 21:25:43 | Ronny.Pfannschmidt | set | recipients:
+ Ronny.Pfannschmidt |
2013-11-19 21:25:43 | Ronny.Pfannschmidt | set | messageid: <1384896343.05.0.723899962428.issue19658@psf.upfronthosting.co.za> |
2013-11-19 21:25:43 | Ronny.Pfannschmidt | link | issue19658 messages |
2013-11-19 21:25:42 | Ronny.Pfannschmidt | create | |
|