summaryrefslogtreecommitdiff
path: root/runtests.py
diff options
context:
space:
mode:
Diffstat (limited to 'runtests.py')
-rwxr-xr-xruntests.py7
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)