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: | |
@@ -322,7 +310,7 b' else:' | |||||
322 | (lambda a, b: isinstance2(a, b, types.MethodType), |
|
310 | (lambda a, b: isinstance2(a, b, types.MethodType), | |
323 | lambda a, b: update_function(a.im_func, b.im_func)), |
|
311 | lambda a, b: update_function(a.im_func, b.im_func)), | |
324 | ]) |
|
312 | ]) | |
325 |
|
313 | |||
326 |
|
314 | |||
327 | def update_generic(a, b): |
|
315 | def update_generic(a, b): | |
328 | for type_check, update in UPDATE_RULES: |
|
316 | for type_check, update in UPDATE_RULES: |
General Comments 0
You need to be logged in to leave comments.
Login now