On Wed, Nov 7, 2012 at 10:40 AM, Devashish Tyagi
<devashishroc...@gmail.com> wrote:
> Here is the code
>
> from code import InteractiveInterpreter
> import StringIO
> import pickle
>
> src = StringIO.StringIO()
> inter = InteractiveInterpreter()
> inter.runcode('a = 5')
> local = inter.locals
>
> pickle.dump(local,open('obj.dump','wb'))After calling runcode it seems that the __builtins__ dict containing an 'Ellipsis' binding has been added to inter.locals. You probably don't want to include the contents of __builtins__ in your pickle anyway, so just delete it: del local['__builtins__'] pickle.dump(local, ...) -- http://mail.python.org/mailman/listinfo/python-list
