From: Antoine Pitrou Date: Tue, 18 Dec 2012 22:28:04 +0000 (+0100) Subject: Call importlib.invalidate_caches() after creating module files in test_threaded_import. X-Git-Tag: v3.3.1rc1~510 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07edb82e4b1d2e45c25295aae6095a346f6b9340;p=python Call importlib.invalidate_caches() after creating module files in test_threaded_import. --- diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py index e0c23dec66..6c2965ba6e 100644 --- a/Lib/test/test_threaded_import.py +++ b/Lib/test/test_threaded_import.py @@ -7,6 +7,7 @@ import os import imp +import importlib import sys import time import shutil @@ -190,6 +191,7 @@ class ThreadedImportTests(unittest.TestCase): f.write(contents.encode('utf-8')) self.addCleanup(forget, name) + importlib.invalidate_caches() results = [] def import_ab(): import A @@ -220,6 +222,7 @@ class ThreadedImportTests(unittest.TestCase): f.write(code.encode('utf-8')) self.addCleanup(unlink, filename) self.addCleanup(forget, TESTFN) + importlib.invalidate_caches() __import__(TESTFN)