summaryrefslogtreecommitdiff
path: root/numpy/distutils/command
diff options
context:
space:
mode:
authorserge-sans-paille <serge.guelton@telecom-bretagne.eu>2022-01-28 19:45:38 +0100
committerserge-sans-paille <serge.guelton@telecom-bretagne.eu>2022-01-28 19:45:38 +0100
commit7764452b738cf7e55e68fdbb935400d56926007d (patch)
treee0dd6cb012a76cf11765bd2f246d7e7c85c03ce3 /numpy/distutils/command
parent62b348239ec43edf47d384b34cd83825293925c9 (diff)
downloadnumpy-7764452b738cf7e55e68fdbb935400d56926007d.tar.gz
Fix build_ext interaction with non numpy extensions
Numpy extensions define the extra_cxx_compile_args and extra_c_compile_args filed, but distutils extensions don't. Take that into account when populating build_extension. Should fix #20928
Diffstat (limited to 'numpy/distutils/command')
-rw-r--r--numpy/distutils/command/build_ext.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index 36a62eb1a..8b568c159 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -393,8 +393,8 @@ class build_ext (old_build_ext):
log.info("building '%s' extension", ext.name)
extra_args = ext.extra_compile_args or []
- extra_cflags = ext.extra_c_compile_args or []
- extra_cxxflags = ext.extra_cxx_compile_args or []
+ extra_cflags = getattr(ext, 'extra_c_compile_args', None) or []
+ extra_cxxflags = getattr(ext, 'extra_cxx_compile_args', None) or []
macros = ext.define_macros[:]
for undef in ext.undef_macros: