Issue #14599: Fix an import caching race condition.
This commit is contained in:
parent
ceffda822f
commit
4132368d0a
|
@ -346,6 +346,7 @@ class ImportTests(unittest.TestCase):
|
||||||
pkg_name = "extension"
|
pkg_name = "extension"
|
||||||
pkg_file = pkg_name + "{}".format("_d.pyd" if debug else ".pyd")
|
pkg_file = pkg_name + "{}".format("_d.pyd" if debug else ".pyd")
|
||||||
with open(pkg_file, "w"): pass
|
with open(pkg_file, "w"): pass
|
||||||
|
importlib.invalidate_caches()
|
||||||
try:
|
try:
|
||||||
with self.assertRaises(ImportError) as err:
|
with self.assertRaises(ImportError) as err:
|
||||||
import extension
|
import extension
|
||||||
|
|
Loading…
Reference in New Issue