Skip to content

Commit

Permalink
Override permission failures when removing cache dirs
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
  • Loading branch information
techalchemy committed Apr 23, 2020
1 parent 61d7223 commit d33537a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ def do_clear():
from pip import locations

try:
vistir.path.rmtree(PIPENV_CACHE_DIR)
vistir.path.rmtree(locations.USER_CACHE_DIR)
vistir.path.rmtree(PIPENV_CACHE_DIR, onerror=vistir.path.handle_remove_readonly)
vistir.path.rmtree(
locations.USER_CACHE_DIR, onerror=vistir.path.handle_remove_readonly
)
except OSError as e:
# Ignore FileNotFoundError. This is needed for Python 2.7.
import errno
Expand Down

0 comments on commit d33537a

Please sign in to comment.