Skip to content

Commit

Permalink
bindepend: use multiprocessing.cpu_count() instead of os.cpu_count()
Browse files Browse the repository at this point in the history
os.cpu_count() is only available since Python 3.4, while multiprocessing
is available since Python 2.6
  • Loading branch information
Giuseppe Corbelli committed Dec 11, 2018
1 parent 8fe2e1a commit 1634d8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PyInstaller/depend/bindepend.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ def Dependencies(lTOC, xtrapath=None, manifest=None, redirects=None):

# 4 processes may yield up to +40% speed on 2 CPUs
# 2 processes may yield up to +30% speed on 2 CPUs
processes = 2 * os.cpu_count()
# os.cpu_count is only available since Python 3.4, while multiprocessing is since 2.6
processes = 2 * multiprocessing.cpu_count()
pool = multiprocessing.Pool(processes)

if is_win:
Expand Down

0 comments on commit 1634d8b

Please sign in to comment.