Skip to content

Commit 56ec435

Browse files
committed
REF: make the separate compilation env handling a tad simpler.
1 parent 963c4e4 commit 56ec435

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

numpy/core/bscript

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ from setup_common \
3030
C99_FUNCS_SINGLE, C99_COMPLEX_TYPES, C99_COMPLEX_FUNCS, \
3131
MANDATORY_FUNCS, C_ABI_VERSION, C_API_VERSION
3232

33-
try:
34-
val = os.environ['NPY_SEPARATE_COMPILATION']
35-
ENABLE_SEPARATE_COMPILATION = (val != "0")
36-
except KeyError:
37-
ENABLE_SEPARATE_COMPILATION = False
33+
ENABLE_SEPARATE_COMPILATION = (os.environ.get('NPY_SEPARATE_COMPILATION', "0") != "0")
3834

3935
NUMPYCONFIG_SYM = []
4036

numpy/core/setup.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@
1212
from setup_common import *
1313

1414
# Set to True to enable multiple file compilations (experimental)
15-
try:
16-
val = os.environ['NPY_SEPARATE_COMPILATION']
17-
ENABLE_SEPARATE_COMPILATION = (val != "0")
18-
except KeyError:
19-
ENABLE_SEPARATE_COMPILATION = False
15+
ENABLE_SEPARATE_COMPILATION = (os.environ.get('NPY_SEPARATE_COMPILATION', "0") != "0")
2016

2117
# XXX: ugly, we use a class to avoid calling twice some expensive functions in
2218
# config.h/numpyconfig.h. I don't see a better way because distutils force

0 commit comments

Comments
 (0)