changeset 76370:00a07720a570

Issue #14599: Fix an import caching race condition.
author Brett Cannon <brett@python.org>
date Mon, 16 Apr 2012 20:50:33 -0400
parents eae7cc54d28b
children 3b5b4b4bb43c
files Lib/test/test_import.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/test/test_import.py	Mon Apr 16 20:48:50 2012 -0400
+++ b/Lib/test/test_import.py	Mon Apr 16 20:50:33 2012 -0400
@@ -346,6 +346,7 @@
         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