Merging upstream version 3.3.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
9c6aec8bfe
commit
f91e0c12b0
11 changed files with 180 additions and 130 deletions
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import concurrent.futures
|
||||
import contextlib
|
||||
import math
|
||||
import multiprocessing
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -22,6 +23,13 @@ TArg = TypeVar('TArg')
|
|||
TRet = TypeVar('TRet')
|
||||
|
||||
|
||||
def cpu_count() -> int:
|
||||
try:
|
||||
return multiprocessing.cpu_count()
|
||||
except NotImplementedError:
|
||||
return 1
|
||||
|
||||
|
||||
def _environ_size(_env: MutableMapping[str, str] | None = None) -> int:
|
||||
environ = _env if _env is not None else getattr(os, 'environb', os.environ)
|
||||
size = 8 * len(environ) # number of pointers in `envp`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue