mirror of https://github.com/python/cpython
Call importlib.invalidate_caches() after creating module files in test_threaded_import.
This commit is contained in:
commit
dcac718236
|
@ -7,6 +7,7 @@
|
|||
|
||||
import os
|
||||
import imp
|
||||
import importlib
|
||||
import sys
|
||||
import time
|
||||
import shutil
|
||||
|
@ -190,6 +191,7 @@ class ThreadedImportTests(unittest.TestCase):
|
|||
f.write(contents.encode('utf-8'))
|
||||
self.addCleanup(forget, name)
|
||||
|
||||
importlib.invalidate_caches()
|
||||
results = []
|
||||
def import_ab():
|
||||
import A
|
||||
|
@ -220,6 +222,7 @@ class ThreadedImportTests(unittest.TestCase):
|
|||
f.write(code.encode('utf-8'))
|
||||
self.addCleanup(unlink, filename)
|
||||
self.addCleanup(forget, TESTFN)
|
||||
importlib.invalidate_caches()
|
||||
__import__(TESTFN)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue