summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-04-01 07:46:54 (GMT)
committerGeorg Brandl <georg@python.org>2006-04-01 07:46:54 (GMT)
commit1c5a59f80a614df368cb7f545112862b2e7e1d5e (patch)
tree62a17c9456896c891fde6f13eb2333c511a0e57e /Lib
parent014d29f33114e3cef49c247d2b5035d4e63763d3 (diff)
downloadcpython-1c5a59f80a614df368cb7f545112862b2e7e1d5e.zip
cpython-1c5a59f80a614df368cb7f545112862b2e7e1d5e.tar.gz
cpython-1c5a59f80a614df368cb7f545112862b2e7e1d5e.tar.bz2
Bug #1458017: make distutils.Log._log more forgiving when passing in
msg strings with '%', but without format args.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/log.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/distutils/log.py b/Lib/distutils/log.py
index cf3ee13..95d4c1c 100644
--- a/Lib/distutils/log.py
+++ b/Lib/distutils/log.py
@@ -20,7 +20,12 @@ class Log:
def _log(self, level, msg, args):
if level >= self.threshold:
- print msg % args
+ if not args:
+ # msg may contain a '%'. If args is empty,
+ # don't even try to string-format
+ print msg
+ else:
+ print msg % args
sys.stdout.flush()
def log(self, level, msg, *args):