Message140877
| Author |
Albert.Zeyer |
| Recipients |
Albert.Zeyer |
| Date |
2011年07月22日.13:49:49 |
| SpamBayes Score |
0.00030564205 |
| Marked as misclassified |
No |
| Message-id |
<1311342590.28.0.333956728566.issue12610@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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> |
|
History
|
|---|
| 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 |
|