minor: revisit _possibly_invalidate_import_caches
This commit is contained in:
parent
5df45f5b27
commit
56dc01ffe0
|
@ -611,12 +611,10 @@ class Testdir(object):
|
||||||
def _possibly_invalidate_import_caches(self):
|
def _possibly_invalidate_import_caches(self):
|
||||||
# invalidate caches if we can (py33 and above)
|
# invalidate caches if we can (py33 and above)
|
||||||
try:
|
try:
|
||||||
import importlib
|
from importlib import invalidate_caches
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
return
|
||||||
else:
|
invalidate_caches()
|
||||||
if hasattr(importlib, "invalidate_caches"):
|
|
||||||
importlib.invalidate_caches()
|
|
||||||
|
|
||||||
def mkdir(self, name):
|
def mkdir(self, name):
|
||||||
"""Create a new (sub)directory."""
|
"""Create a new (sub)directory."""
|
||||||
|
|
Loading…
Reference in New Issue