summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/run-tests.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 3dc0df029..6af70cb83 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -65,7 +65,9 @@ injected_import_hook_code = """\
import sys, os, io, vfs
class __File(io.IOBase):
def __init__(self):
- sys.modules['__injected_test'].__name__ = '__main__'
+ module = sys.modules['__injected_test']
+ module.__name__ = '__main__'
+ sys.modules['__main__'] = module
self.off = 0
def ioctl(self, request, arg):
if request == 4: # MP_STREAM_CLOSE