Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e57ac64

Browse files
committed
Small changes towards supporting Python 3.
1 parent 5326df5 commit e57ac64

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

IPython/core/interactiveshell.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,10 @@ def __init__(self, config=None, ipython_dir=None, profile_dir=None,
414414
# We save this here in case user code replaces raw_input, but it needs
415415
# to be after init_readline(), because PyPy's readline works by replacing
416416
# raw_input.
417-
self.raw_input_original = raw_input
417+
if py3compat.PY3:
418+
self.raw_input_original = input
419+
else:
420+
self.raw_input_original = raw_input
418421
# init_completer must come after init_readline, because it needs to
419422
# know whether readline is present or not system-wide to configure the
420423
# completers, since the completion machinery can now operate

IPython/core/magic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
from IPython.utils.timing import clock, clock2
6262
from IPython.utils.warn import warn, error
6363
from IPython.utils.ipstruct import Struct
64-
import IPython.utils.generics
6564

6665
#-----------------------------------------------------------------------------
6766
# Utility functions

IPython/lib/deepreload.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ def deep_reload_hook(module):
159159
return import_module(name[i+1:], name, parent)
160160

161161
# Save the original hooks
162-
original_reload = __builtin__.reload
162+
try:
163+
original_reload = __builtin__.reload
164+
except AttributeError:
165+
original_reload = imp.reload # Python 3
163166

164167
# Replacement for reload()
165168
def reload(module, exclude=['sys', '__builtin__', '__main__']):

IPython/utils/nested_context.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def nested(*managers):
2121
do_something()
2222
2323
"""
24-
warn("With-statements now directly support multiple context managers",
25-
DeprecationWarning, 3)
2624
exits = []
2725
vars = []
2826
exc = (None, None, None)

0 commit comments

Comments
 (0)