New submission from Albert Zeyer <alb...@googlemail.com>: 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> ---------- messages: 140877 nosy: Albert.Zeyer priority: normal severity: normal status: open title: Fatal Python error: non-string found in code slot versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12610> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com