Skip to content

Commit 5c58da7

Browse files
committed
Handle file not found for windows file urls. (#11)
* Handle file not found for windows file urls. * Update common.py
1 parent a44020f commit 5c58da7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/__np__/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ def download_file(url, destination):
188188
raise
189189
except URLError as e:
190190
# Seems that macOS throws this error instead for file:// links. :(
191-
if 'Errno 2' in str(e.reason):
191+
if 'Errno 2' in str(e.reason) or 'WinError 3' in str(e.reason):
192+
raise NoSuchURL(url)
193+
else:
194+
raise
195+
except OSError as e:
196+
if e.errno == 2:
192197
raise NoSuchURL(url)
193198
else:
194199
raise

0 commit comments

Comments
 (0)