upip: A bit better reporting of networking errors.

pull/106/head
Paul Sokolovsky 2016-10-08 14:56:09 +03:00
rodzic 29c90a6231
commit 1ca07881e3
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -120,11 +120,13 @@ def url_open(url):
l = s.readline()
protover, status, msg = l.split(None, 2)
if status != b"200":
raise OSError()
if status == b"404":
print("Package not found")
raise ValueError(status)
while 1:
l = s.readline()
if not l:
raise OSError()
raise ValueError("Unexpected EOF")
if l == b'\r\n':
break