Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pip/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,14 @@ def unpack_http_url(link, location, download_dir=None, session=None):

if not already_downloaded_path:
os.unlink(from_path)
os.rmdir(temp_dir)

"""remove directory can fail with oserror due virus scanner locking,
try and notify user if it fails"""
try:
os.rmdir(temp_dir)
except OSError:
logger.warn('Sorry, clearing our temp files fails. '
'You may do it manually for %s', temp_dir)


def unpack_file_url(link, location, download_dir=None):
Expand Down