summaryrefslogtreecommitdiff
path: root/Lib/importlib/test/source/test_file_loader.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/importlib/test/source/test_file_loader.py')
-rw-r--r--Lib/importlib/test/source/test_file_loader.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/test/source/test_file_loader.py b/Lib/importlib/test/source/test_file_loader.py
index c7a7d8fbca..b4d7e7dba9 100644
--- a/Lib/importlib/test/source/test_file_loader.py
+++ b/Lib/importlib/test/source/test_file_loader.py
@@ -127,7 +127,8 @@ class SimpleTest(unittest.TestCase):
finally:
os.unlink(file_path)
pycache = os.path.dirname(imp.cache_from_source(file_path))
- shutil.rmtree(pycache)
+ if os.path.exists(pycache):
+ shutil.rmtree(pycache)
def test_timestamp_overflow(self):
# When a modification timestamp is larger than 2**32, it should be