if data is not None:
h.send(data)
errcode, errmsg, headers = h.getreply()
+ fp = h.getfile()
if errcode == -1:
+ if fp: fp.close()
# something went wrong with the HTTP status line
raise IOError, ('http protocol error', 0,
'got a bad status line', None)
- fp = h.getfile()
if errcode == 200:
return addinfourl(fp, headers, "http:" + url)
else:
if data is not None:
h.send(data)
errcode, errmsg, headers = h.getreply()
+ fp = h.getfile()
if errcode == -1:
+ if fp: fp.close()
# something went wrong with the HTTP status line
raise IOError, ('http protocol error', 0,
'got a bad status line', None)
- fp = h.getfile()
if errcode == 200:
return addinfourl(fp, headers, "https:" + url)
else: