summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Kaufmann <roland.kaufmann@uni.no>2016-12-09 09:14:12 +0100
committerRoland Kaufmann <roland.kaufmann@uni.no>2016-12-09 09:14:12 +0100
commita98bd6bd070bb595f559727ace2f2bc9747ec7d7 (patch)
treea7e1e10e591b96d0f55877c2da01aaa6de556e5a
parent98b3eabe44c97c3aeb66cd6aaf52c747f97d5ac8 (diff)
downloadnumpy-a98bd6bd070bb595f559727ace2f2bc9747ec7d7.tar.gz
STY: Avoid using string formatting in log calls
The log class (derived from distutils.log) does string formatting with extra arguments passed, if (and only if) the log level is above the set threshold. That way, the cost of string formatting only incurs if the message is actually going to be displayed.
-rw-r--r--numpy/distutils/mingw32ccompiler.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py
index f5412f91e..92dd7c539 100644
--- a/numpy/distutils/mingw32ccompiler.py
+++ b/numpy/distutils/mingw32ccompiler.py
@@ -394,8 +394,7 @@ def _build_import_library_amd64():
# didn't exist in virtualenv, maybe in base distribution?
base_file = os.path.join(sys.base_prefix, 'libs', out_name)
if os.path.isfile(base_file):
- log.debug('Skip building import library: "%s" exists' %
- (base_file))
+ log.debug('Skip building import library: "%s" exists', base_file)
return
def_name = "python%d%d.def" % tuple(sys.version_info[:2])
@@ -423,17 +422,17 @@ def _build_import_library_x86():
if os.path.isfile(base_lib):
lib_file = base_lib
else:
- log.warn('Cannot build import library: "%s" not found' % (lib_file))
+ log.warn('Cannot build import library: "%s" not found', lib_file)
return
if os.path.isfile(out_file):
- log.debug('Skip building import library: "%s" exists' % (out_file))
+ log.debug('Skip building import library: "%s" exists', out_file)
return
# didn't find in virtualenv, try base distribution, too
base_file = os.path.join(sys.base_prefix, 'libs', out_name)
if os.path.isfile(base_file):
- log.debug('Skip building import library: "%s" exists' % (out_file))
+ log.debug('Skip building import library: "%s" exists', out_file)
return
- log.info('Building import library (ARCH=x86): "%s"' % (out_file))
+ log.info('Building import library (ARCH=x86): "%s"', out_file)
from numpy.distutils import lib2def