Permalink
Browse files

fixup

  • Loading branch information...
1 parent 0e38431 commit c195de49cd7f9927849cb5d3aebff498f9389259 @bfroehle committed Sep 27, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 IPython/core/magics/execution.py
@@ -13,7 +13,10 @@
#-----------------------------------------------------------------------------
# Stdlib
-import __builtin__ as builtin_mod
+try:
+ import __builtin__ as builtin_mod
+except ImportError:
+ import builtins as builtin_mod
import bdb
import os
import sys
@@ -634,7 +637,7 @@ def run(self, parameter_s='', runner=None,
# Since this seems to be done by the interpreter itself, the best
# we can do is to at least restore __builtins__ for the user on
# exit.
- self.shell.user_ns['__builtins__'] = builtin_mod
+ self.shell.user_ns[builtin_mod.__name__] = builtin_mod
# Ensure key global structures are restored
sys.argv = save_argv

0 comments on commit c195de4

Please sign in to comment.