mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Fix status line parsing
This commit is contained in:
parent
92131946f7
commit
8c28d14471
1 changed files with 5 additions and 1 deletions
|
@ -49,7 +49,11 @@ class CachedResponse(object):
|
|||
if not os.path.exists(filename):
|
||||
self._cache_url(filename)
|
||||
fp = open(filename, 'rb')
|
||||
self.code, self.msg = fp.next().strip().split()
|
||||
try:
|
||||
line = fp.next().strip()
|
||||
self.code, self.msg = line.split(None, 1)
|
||||
except ValueError:
|
||||
raise ValueError('Bad field line: %r' % line)
|
||||
self.code = int(self.code)
|
||||
for line in fp:
|
||||
if line == '\n':
|
||||
|
|
Loading…
Reference in a new issue