mirror of https://github.com/pypa/pip
Raise InstallationError if local requirements file could not be found.
This commit is contained in:
parent
2f44bcd392
commit
37aa31c9f9
|
@ -51,9 +51,13 @@ def get_file_content(url, comes_from=None):
|
|||
## FIXME: catch some errors
|
||||
resp = urlopen(url)
|
||||
return geturl(resp), resp.read()
|
||||
f = open(url)
|
||||
content = f.read()
|
||||
f.close()
|
||||
try:
|
||||
f = open(url)
|
||||
content = f.read()
|
||||
except IOError, e:
|
||||
raise InstallationError('Could not open requirements file: %s' % str(e))
|
||||
else:
|
||||
f.close()
|
||||
return url, content
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue