Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
bmartinn committed May 31, 2020
1 parent 7c286cd commit 4ddd162
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pip/_internal/req/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ def install_given_reqs(
# pre allocate installed package names
installed = [None] * len(to_install)
install_args = [install_options, global_options, dict(
root=root, home=home, prefix=prefix, warn_script_location=warn_script_location,
use_user_site=use_user_site, pycompile=pycompile)]
root=root, home=home, prefix=prefix,
warn_script_location=warn_script_location,
use_user_site=use_user_site, pycompile=pycompile)]

if Pool is not None:
# first let's try to install in parallel, if we fail we do it by order.
pool = Pool()
try:
pool_result = pool.starmap_async(__single_install, [(install_args, r) for r in to_install])
pool_result = pool.starmap_async(
__single_install, [(install_args, r) for r in to_install])
# python 2.7 timeout=None will not catch KeyboardInterrupt
installed = pool_result.get(timeout=999999)
except (KeyboardInterrupt, SystemExit):
Expand All @@ -87,7 +89,8 @@ def install_given_reqs(
with indent_log():
for i, requirement in enumerate(to_install):
if installed[i] is None:
installed[i] = __single_install(install_args, requirement, allow_raise=True)
installed[i] = __single_install(
install_args, requirement, allow_raise=True)

return [i for i in installed if i is not None]

Expand Down

0 comments on commit 4ddd162

Please sign in to comment.