Issue #14599: Fix an import caching race condition.

This commit is contained in:
Brett Cannon 2012-04-16 20:50:33 -04:00
parent ceffda822f
commit 4132368d0a
1 changed files with 1 additions and 0 deletions

View 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