diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-07-18 17:48:50 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-07-18 17:48:50 -0600 |
commit | bfa4ad3f93608074bacf04c4d9ed0546dd443163 (patch) | |
tree | 6cbdbb331748d10c1dea918fce8c6c029d384b50 /runtests.py | |
parent | 055056a3108ab19883e50ac125ab9974823498c7 (diff) | |
download | numpy-bfa4ad3f93608074bacf04c4d9ed0546dd443163.tar.gz |
MAINT: Fix remaining uses of deprecated Python imp module.
Diffstat (limited to 'runtests.py')
-rwxr-xr-x | runtests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtests.py b/runtests.py index b833bbd04..8d1758e34 100755 --- a/runtests.py +++ b/runtests.py @@ -148,14 +148,17 @@ def main(argv): if args.python: # Debugging issues with warnings is much easier if you can see them print("Enabling display of all warnings") - import warnings; warnings.filterwarnings("always") + import warnings + import types + + warnings.filterwarnings("always") if extra_argv: # Don't use subprocess, since we don't want to include the # current path in PYTHONPATH. sys.argv = extra_argv with open(extra_argv[0], 'r') as f: script = f.read() - sys.modules['__main__'] = imp.new_module('__main__') + sys.modules['__main__'] = types.ModuleType('__main__') ns = dict(__name__='__main__', __file__=extra_argv[0]) exec_(script, ns) |