mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #855 from JackDanger/jack/set-timeout-on-fetching-warehouse-hashes
set timeout on fetching warehouse hashes
This commit is contained in:
+3
-2
@@ -478,7 +478,7 @@ def resolve_deps(deps, which, which_pip, project, sources=None, verbose=False, p
|
||||
if 'python.org' in '|'.join([source['url'] for source in sources]):
|
||||
try:
|
||||
# Grab the hashes from the new warehouse API.
|
||||
r = requests.get('https://pypi.org/pypi/{0}/json'.format(name))
|
||||
r = requests.get('https://pypi.org/pypi/{0}/json'.format(name), timeout=10)
|
||||
api_releases = r.json()['releases']
|
||||
|
||||
cleaned_releases = {}
|
||||
@@ -495,7 +495,8 @@ def resolve_deps(deps, which, which_pip, project, sources=None, verbose=False, p
|
||||
collected_hashes = list(list(resolver.resolve_hashes([result]).items())[0][1])
|
||||
|
||||
except (ValueError, KeyError):
|
||||
pass
|
||||
if verbose:
|
||||
print('Error fetching {}'.format(name))
|
||||
|
||||
d = {'name': name, 'version': version, 'hashes': collected_hashes}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user