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):
|
||||
# invalidate caches if we can (py33 and above)
|
||||
try:
|
||||
import importlib
|
||||
from importlib import invalidate_caches
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
if hasattr(importlib, "invalidate_caches"):
|
||||
importlib.invalidate_caches()
|
||||
return
|
||||
invalidate_caches()
|
||||
|
||||
def mkdir(self, name):
|
||||
"""Create a new (sub)directory."""
|
||||
|
|
Loading…
Reference in New Issue