kopia lustrzana https://github.com/micropython/micropython-lib
upip: A bit better reporting of networking errors.
rodzic
29c90a6231
commit
1ca07881e3
|
@ -120,11 +120,13 @@ def url_open(url):
|
||||||
l = s.readline()
|
l = s.readline()
|
||||||
protover, status, msg = l.split(None, 2)
|
protover, status, msg = l.split(None, 2)
|
||||||
if status != b"200":
|
if status != b"200":
|
||||||
raise OSError()
|
if status == b"404":
|
||||||
|
print("Package not found")
|
||||||
|
raise ValueError(status)
|
||||||
while 1:
|
while 1:
|
||||||
l = s.readline()
|
l = s.readline()
|
||||||
if not l:
|
if not l:
|
||||||
raise OSError()
|
raise ValueError("Unexpected EOF")
|
||||||
if l == b'\r\n':
|
if l == b'\r\n':
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue