Merging upstream version 3.4.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
30c21d6b63
commit
e84e03e022
13 changed files with 183 additions and 19 deletions
|
@ -24,6 +24,14 @@ TRet = TypeVar('TRet')
|
|||
|
||||
|
||||
def cpu_count() -> int:
|
||||
try:
|
||||
# On systems that support it, this will return a more accurate count of
|
||||
# usable CPUs for the current process, which will take into account
|
||||
# cgroup limits
|
||||
return len(os.sched_getaffinity(0))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
return multiprocessing.cpu_count()
|
||||
except NotImplementedError:
|
||||
|
@ -170,7 +178,8 @@ def xargs(
|
|||
results = thread_map(run_cmd_partition, partitions)
|
||||
|
||||
for proc_retcode, proc_out, _ in results:
|
||||
retcode = max(retcode, proc_retcode)
|
||||
if abs(proc_retcode) > abs(retcode):
|
||||
retcode = proc_retcode
|
||||
stdout += proc_out
|
||||
|
||||
return retcode, stdout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue