Bug #1458017: make distutils.Log._log more forgiving when passing in

msg strings with '%', but without format args.
This commit is contained in:
Georg Brandl 2006-04-01 07:46:54 +00:00
parent 014d29f331
commit 1c5a59f80a
1 changed files with 6 additions and 1 deletions

View File

@ -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):