File tree 2 files changed +11
-8
lines changed
2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 10
10
from numpy .distutils import log
11
11
from distutils .dep_util import newer
12
12
from distutils .sysconfig import get_config_var
13
- from numpy ._build_utils .apple_accelerate import (uses_accelerate_framework ,
14
- get_sgemv_fix )
15
-
13
+ from numpy ._build_utils .apple_accelerate import (
14
+ uses_accelerate_framework , get_sgemv_fix
15
+ )
16
+ from numpy .compat import npy_load_module
16
17
from setup_common import *
17
18
18
19
# Set to True to enable relaxed strides checking. This (mostly) means
@@ -386,9 +387,8 @@ def configuration(parent_package='',top_path=None):
386
387
387
388
generate_umath_py = join (codegen_dir , 'generate_umath.py' )
388
389
n = dot_join (config .name , 'generate_umath' )
389
- generate_umath = imp .load_module ('_' .join (n .split ('.' )),
390
- open (generate_umath_py , 'U' ), generate_umath_py ,
391
- ('.py' , 'U' , 1 ))
390
+ generate_umath = npy_load_module ('_' .join (n .split ('.' )),
391
+ generate_umath_py , ('.py' , 'U' , 1 ))
392
392
393
393
header_dir = 'include/numpy' # this is relative to config.path_in_package
394
394
Original file line number Diff line number Diff line change @@ -148,14 +148,17 @@ def main(argv):
148
148
if args .python :
149
149
# Debugging issues with warnings is much easier if you can see them
150
150
print ("Enabling display of all warnings" )
151
- import warnings ; warnings .filterwarnings ("always" )
151
+ import warnings
152
+ import types
153
+
154
+ warnings .filterwarnings ("always" )
152
155
if extra_argv :
153
156
# Don't use subprocess, since we don't want to include the
154
157
# current path in PYTHONPATH.
155
158
sys .argv = extra_argv
156
159
with open (extra_argv [0 ], 'r' ) as f :
157
160
script = f .read ()
158
- sys .modules ['__main__' ] = imp . new_module ('__main__' )
161
+ sys .modules ['__main__' ] = types . ModuleType ('__main__' )
159
162
ns = dict (__name__ = '__main__' ,
160
163
__file__ = extra_argv [0 ])
161
164
exec_ (script , ns )
You can’t perform that action at this time.
0 commit comments