Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Small changes towards supporting Python 3.

  • Loading branch information...
commit e57ac64d83c51c0f12e8279603082bf8c8c5054c 1 parent 5326df5
@takluyver authored
View
5 IPython/core/interactiveshell.py
@@ -414,7 +414,10 @@ def __init__(self, config=None, ipython_dir=None, profile_dir=None,
# We save this here in case user code replaces raw_input, but it needs
# to be after init_readline(), because PyPy's readline works by replacing
# raw_input.
- self.raw_input_original = raw_input
+ if py3compat.PY3:
+ self.raw_input_original = input
+ else:
+ self.raw_input_original = raw_input
# init_completer must come after init_readline, because it needs to
# know whether readline is present or not system-wide to configure the
# completers, since the completion machinery can now operate
View
1  IPython/core/magic.py
@@ -61,7 +61,6 @@
from IPython.utils.timing import clock, clock2
from IPython.utils.warn import warn, error
from IPython.utils.ipstruct import Struct
-import IPython.utils.generics
#-----------------------------------------------------------------------------
# Utility functions
View
5 IPython/lib/deepreload.py
@@ -159,7 +159,10 @@ def deep_reload_hook(module):
return import_module(name[i+1:], name, parent)
# Save the original hooks
-original_reload = __builtin__.reload
+try:
+ original_reload = __builtin__.reload
+except AttributeError:
+ original_reload = imp.reload # Python 3
# Replacement for reload()
def reload(module, exclude=['sys', '__builtin__', '__main__']):
View
2  IPython/utils/nested_context.py
@@ -21,8 +21,6 @@ def nested(*managers):
do_something()
"""
- warn("With-statements now directly support multiple context managers",
- DeprecationWarning, 3)
exits = []
vars = []
exc = (None, None, None)
Please sign in to comment.
Something went wrong with that request. Please try again.