Message140877
Code:
```
from ast import *
globalsDict = {}
body = [
Assign(targets=[Name(id=u'argc', ctx=Store())],
value=Name(id=u'None', ctx=Load())),
]
exprAst = Interactive(body=[
FunctionDef(
name='foo',
args=arguments(args=[Name(id=u'argc', ctx=Param()), Name(id=u'argv', ctx=Param())],
vararg=None, kwarg=None, defaults=[]),
body=body,
decorator_list=[])])
fix_missing_locations(exprAst)
compiled = compile(exprAst, "<foo>", "single")
eval(compiled, {}, globalsDict)
f = globalsDict["foo"]
print(f)
```
CPython 2.7.1: Fatal Python error: non-string found in code slot
PyPy 1.5: <function foo at 0x0000000103114430> |
|
Date |
User |
Action |
Args |
2011-07-22 13:49:50 | Albert.Zeyer | set | recipients:
+ Albert.Zeyer |
2011-07-22 13:49:50 | Albert.Zeyer | set | messageid: <1311342590.28.0.333956728566.issue12610@psf.upfronthosting.co.za> |
2011-07-22 13:49:49 | Albert.Zeyer | link | issue12610 messages |
2011-07-22 13:49:49 | Albert.Zeyer | create | |
|