##// END OF EJS Templates
Fix contextlib imports for python3 as per @takluyver's review.
Fernando Perez -
Show More
@@ -28,8 +28,13 b' import runpy'
28 28 import sys
29 29 import tempfile
30 30 import types
31 import urllib
32 from io import open as io_open
31
32 # We need to use nested to support python 2.6, once we move to >=2.7, we can
33 # use the with keyword's new builtin support for nested managers
34 try:
35 from contextlib import nested
36 except:
37 from IPython.utils.nested_context import nested
33 38
34 39 from IPython.config.configurable import SingletonConfigurable
35 40 from IPython.core import debugger, oinspect
@@ -25,9 +25,15 b' Notes'
25 25 from __future__ import with_statement
26 26
27 27 import sys
28 from contextlib import nested
29 28 import warnings
30 29
30 # We need to use nested to support python 2.6, once we move to >=2.7, we can
31 # use the with keyword's new builtin support for nested managers
32 try:
33 from contextlib import nested
34 except:
35 from IPython.utils.nested_context import nested
36
31 37 from IPython.core import ultratb
32 38 from IPython.core.magic import Magics, magics_class, line_magic
33 39 from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
@@ -20,7 +20,12 b' import re'
20 20 import sys
21 21 import textwrap
22 22
23 from contextlib import nested
23 # We need to use nested to support python 2.6, once we move to >=2.7, we can
24 # use the with keyword's new builtin support for nested managers
25 try:
26 from contextlib import nested
27 except:
28 from IPython.utils.nested_context import nested
24 29
25 30 from IPython.core.error import TryNext, UsageError
26 31 from IPython.core.usage import interactive_usage, default_banner
General Comments 0
You need to be logged in to leave comments. Login now