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:
parent
7a59f0dc10
commit
3c5ddbb1df
1 changed files with 11 additions and 0 deletions
11
math/py-numpy/files/patch-numpy_distutils_misc__util.py
Normal file
11
math/py-numpy/files/patch-numpy_distutils_misc__util.py
Normal 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))
|
||||
Loading…
Add table
Reference in a new issue