1
0
Fork 0

Merging upstream version 3.3.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:41:54 +01:00
parent 9c6aec8bfe
commit f91e0c12b0
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
11 changed files with 180 additions and 130 deletions

View file

@ -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`