summaryrefslogtreecommitdiff
path: root/numpy/distutils/command/build_ext.py
diff options
context:
space:
mode:
authorSayed Adel <seiko@imavr.com>2021-05-04 08:00:48 +0200
committerSayed Adel <seiko@imavr.com>2021-05-04 08:49:01 +0200
commit034aedc545c03417c0dae1b20c84098459c4b3a4 (patch)
tree35b7865b103064c6a39a42e932e8e1c4e02e37fc /numpy/distutils/command/build_ext.py
parentccfd68d88fa356d7f097e216fb2c16b14da4052d (diff)
downloadnumpy-034aedc545c03417c0dae1b20c84098459c4b3a4.tar.gz
BLD, BUG: Fix compiler optimization log AttributeError
The error appears when option `build` is represented before `bdist_wheel`.
Diffstat (limited to 'numpy/distutils/command/build_ext.py')
-rw-r--r--numpy/distutils/command/build_ext.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index 91cb0d897..ca29ad4c0 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -160,11 +160,12 @@ class build_ext (old_build_ext):
log.info("Detected changes on compiler optimizations, force rebuilding")
self.force = True
- import atexit
- def report():
+ def report(copt):
log.info("\n########### EXT COMPILER OPTIMIZATION ###########")
- log.info(self.compiler_opt.report(full=True))
- atexit.register(report)
+ log.info(copt.report(full=True))
+
+ import atexit
+ atexit.register(report, self.compiler_opt)
# Setup directory for storing generated extra DLL files on Windows
self.extra_dll_dir = os.path.join(self.build_temp, '.libs')