From: Brett Cannon Date: Tue, 17 Apr 2012 00:50:33 +0000 (-0400) Subject: Issue #14599: Fix an import caching race condition. X-Git-Tag: v3.3.0a3~184 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4132368d0aeaba66195c75686dcb16d5e841bb7d;p=thirdparty%2FPython%2Fcpython.git Issue #14599: Fix an import caching race condition. --- diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 5053d49f4639..71a1cd53c2ec 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -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