##// END OF EJS Templates
imp module deprecated in 3.4...
Matthias Bussonnier -
Show More
@@ -13,7 +13,11 b' from IPython.utils.path import ensure_dir_exists'
13 from traitlets import Instance
13 from traitlets import Instance
14 from IPython.utils.py3compat import PY3
14 from IPython.utils.py3compat import PY3
15 if PY3:
15 if PY3:
16 from imp import reload
16 try:
17 from importlib import reload
18 except ImportError :
19 ## deprecated since 3.4
20 from imp import reload
17
21
18 #-----------------------------------------------------------------------------
22 #-----------------------------------------------------------------------------
19 # Main class
23 # Main class
@@ -228,7 +228,11 b' def _list_readline(x):'
228 # Code for going between .py files and cached .pyc files ----------------------
228 # Code for going between .py files and cached .pyc files ----------------------
229
229
230 try: # Python 3.2, see PEP 3147
230 try: # Python 3.2, see PEP 3147
231 from imp import source_from_cache, cache_from_source
231 try:
232 from importlib.util import source_from_cache, cache_from_source
233 except ImportError :
234 ## deprecated since 3.4
235 from imp import source_from_cache, cache_from_source
232 except ImportError:
236 except ImportError:
233 # Python <= 3.1: .pyc files go next to .py
237 # Python <= 3.1: .pyc files go next to .py
234 def source_from_cache(path):
238 def source_from_cache(path):
General Comments 0
You need to be logged in to leave comments. Login now