From 1c5a59f80a614df368cb7f545112862b2e7e1d5e Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 1 Apr 2006 07:46:54 +0000 Subject: [PATCH] Bug #1458017: make distutils.Log._log more forgiving when passing in msg strings with '%', but without format args. --- Lib/distutils/log.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/distutils/log.py b/Lib/distutils/log.py index cf3ee136e0..95d4c1c5a2 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): -- 2.40.0