8000 Merge pull request #18899 from seiko2plus/issue_18892_p0 · numpy/numpy@e563181 · GitHub
[go: up one dir, main page]

Skip to content

Commit e563181

Browse files
authored
Merge pull request #18899 from seiko2plus/issue_18892_p0
BLD, BUG: Fix compiler optimization log AttributeError
2 parents ccfd68d + 034aedc commit e563181

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

numpy/distutils/command/build_clib.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ def run(self):
132132
log.info("Detected changes on compiler optimizations, force rebuilding")
133133
self.force = True
134134

135-
import atexit
136-
def report():
135+
def report(copt):
137136
log.info("\n########### CLIB COMPILER OPTIMIZATION ###########")
138-
log.info(self.compiler_opt.report(full=True))
137+
log.info(copt.report(full=True))
139138

140-
atexit.register(report)
139+
import atexit
140+
atexit.register(report, self.compiler_opt)
141141

142142
if self.have_f_sources():
143143
from numpy.distutils.fcompiler import new_fcompiler

numpy/distutils/command/build_ext.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,12 @@ def run(self):
160160
log.info("Detected changes on compiler optimizations, force rebuilding")
161161
self.force = True
162162

163-
import atexit
164-
def report():
163+
def report(copt):
165164
log.info("\n########### EXT COMPILER OPTIMIZATION ###########")
166-
log.info(self.compiler_opt.report(full=True))
167-
atexit.register(report)
165+
log.info(copt.report(full=True))
166+
167+
import atexit
168+
atexit.register(report, self.compiler_opt)
168169

169170
# Setup directory for storing generated extra DLL files on Windows
170171
self.extra_dll_dir = os.path.join(self.build_temp, '.libs')

0 commit comments

Comments
 (0)
0