upip: Be sure to close socket if we abort with error early.

Need to close properly in more places.
pull/158/head
Paul Sokolovsky 2017-02-08 01:14:01 +03:00
rodzic a86e7cf5a7
commit 1f91189e04
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -127,6 +127,7 @@ def url_open(url):
l = s.readline()
protover, status, msg = l.split(None, 2)
if status != b"200":
s.close()
exc = ValueError(status)
if status == b"404":
fatal("Package not found", exc)
@ -134,6 +135,7 @@ def url_open(url):
while 1:
l = s.readline()
if not l:
s.close()
fatal("Unexpected EOF in HTTP headers", ValueError())
if l == b'\r\n':
break