From: Georg Brandl Date: Sat, 1 Apr 2006 07:46:57 +0000 (+0000) Subject: Bug #1458017: make distutils.Log._log more forgiving when passing in X-Git-Tag: v2.4.4c1~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9be60ec51ec09937ec7ec7931e2f3844bec114a9;p=thirdparty%2FPython%2Fcpython.git Bug #1458017: make distutils.Log._log more forgiving when passing in msg strings with '%', but without format args. (backport from rev. 43529) --- diff --git a/Lib/distutils/log.py b/Lib/distutils/log.py index cf3ee136e0ad..95d4c1c5a21f 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):