mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
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
1 changed files with 6 additions and 1 deletions
|
|
@ -20,7 +20,12 @@ def __init__(self, threshold=WARN):
|
|||
|
||||
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…
Add table
Add a link
Reference in a new issue