Bug #1458017: make distutils.Log._log more forgiving when passing in
msg strings with '%', but without format args.
This commit is contained in:
parent
014d29f331
commit
1c5a59f80a
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue