math/py-numpy: allow fallback in CPU count

FreeBSD 13.2 causes an unhandled exception (OverflowError), but
just make sure we always run the fallback and be done with it.
This commit is contained in:
Franco Fichtner 2023-07-17 13:29:50 +02:00
parent 7a59f0dc10
commit 3c5ddbb1df

View file

@ -0,0 +1,11 @@
--- numpy/distutils/misc_util.py.orig 2022-12-26 03:52:53 UTC
+++ numpy/distutils/misc_util.py
@@ -91,7 +91,7 @@ def get_num_build_jobs():
from numpy.distutils.core import get_distribution
try:
cpu_count = len(os.sched_getaffinity(0))
- except AttributeError:
+ except Exception:
cpu_count = multiprocessing.cpu_count()
cpu_count = min(cpu_count, 8)
envjobs = int(os.environ.get("NPY_NUM_BUILD_JOBS", cpu_count))