1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Only delete the user cache if it's populated

This commit is contained in:
Donald Stufft 2015-05-13 18:11:19 -04:00
parent a0e73f069c
commit 5bbf3fd3ff

View file

@ -151,7 +151,8 @@ def virtualenv(tmpdir, monkeypatch, isolate):
)
# Clean out our cache: creating the venv injects wheels into it.
shutil.rmtree(appdirs.user_cache_dir("pip"))
if os.path.exists(appdirs.user_cache_dir("pip")):
shutil.rmtree(appdirs.user_cache_dir("pip"))
# Undo our monkeypatching of shutil
monkeypatch.undo()