]> granicus.if.org Git - python/commitdiff
Issue #14599: Fix an import caching race condition.
authorBrett Cannon <brett@python.org>
Tue, 17 Apr 2012 00:50:33 +0000 (20:50 -0400)
committerBrett Cannon <brett@python.org>
Tue, 17 Apr 2012 00:50:33 +0000 (20:50 -0400)
Lib/test/test_import.py

index 5053d49f4639982ede5468592ba6d2114b80f8ba..71a1cd53c2ec80e4aefedce1d8ed8620219aa214 100644 (file)
@@ -346,6 +346,7 @@ class ImportTests(unittest.TestCase):
         pkg_name = "extension"
         pkg_file = pkg_name + "{}".format("_d.pyd" if debug else ".pyd")
         with open(pkg_file, "w"): pass
+        importlib.invalidate_caches()
         try:
             with self.assertRaises(ImportError) as err:
                 import extension