##// END OF EJS Templates
Merge pull request #2795 from kmike/autoreload-cleanup...
Thomas Kluyver -
r9133:0582f927 merge
parent child Browse files
Show More
@@ -107,7 +107,6 b' skip_doctest = True'
107 # Imports
107 # Imports
108 #-----------------------------------------------------------------------------
108 #-----------------------------------------------------------------------------
109
109
110 import imp
111 import os
110 import os
112 import sys
111 import sys
113 import traceback
112 import traceback
@@ -127,16 +126,6 b' from IPython.utils.py3compat import PY3'
127 # Autoreload functionality
126 # Autoreload functionality
128 #------------------------------------------------------------------------------
127 #------------------------------------------------------------------------------
129
128
130 def _get_compiled_ext():
131 """Official way to get the extension of compiled files (.pyc or .pyo)"""
132 for ext, mode, typ in imp.get_suffixes():
133 if typ == imp.PY_COMPILED:
134 return ext
135
136
137 PY_COMPILED_EXT = _get_compiled_ext()
138
139
140 class ModuleReloader(object):
129 class ModuleReloader(object):
141 enabled = False
130 enabled = False
142 """Whether this reloader is enabled"""
131 """Whether this reloader is enabled"""
@@ -218,7 +207,6 b' class ModuleReloader(object):'
218 path, ext = os.path.splitext(filename)
207 path, ext = os.path.splitext(filename)
219
208
220 if ext.lower() == '.py':
209 if ext.lower() == '.py':
221 ext = PY_COMPILED_EXT
222 pyc_filename = pyfile.cache_from_source(filename)
210 pyc_filename = pyfile.cache_from_source(filename)
223 py_filename = filename
211 py_filename = filename
224 else:
212 else:
General Comments 0
You need to be logged in to leave comments. Login now