Albert Zeyer <alb...@googlemail.com> added the comment: Simplified code:
``` from ast import * globalsDict = {} exprAst = Interactive(body=[ FunctionDef( name=u'foo', args=arguments(args=[], vararg=None, kwarg=None, defaults=[]), body=[Pass()], decorator_list=[])]) fix_missing_locations(exprAst) compiled = compile(exprAst, "<foo>", "single") eval(compiled, {}, globalsDict) f = globalsDict["foo"] print(f) ``` If I change `name=u'foo'` to `name='foo'`, it works. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12609> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com