[Python-checkins] r43530 - python/branches/release24-maint/Lib/distutils/log.py
georg.brandl
python-checkins at python.org
Sat Apr 1 09:46:57 CEST 2006
Author: georg.brandl
Date: Sat Apr 1 09:46:57 2006
New Revision: 43530
Modified:
python/branches/release24-maint/Lib/distutils/log.py
Log:
Bug #1458017: make distutils.Log._log more forgiving when passing in
msg strings with '%', but without format args.
(backport from rev. 43529)
Modified: python/branches/release24-maint/Lib/distutils/log.py
==============================================================================
--- python/branches/release24-maint/Lib/distutils/log.py (original)
+++ python/branches/release24-maint/Lib/distutils/log.py Sat Apr 1 09:46:57 2006
@@ -20,7 +20,12 @@
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):
More information about the Python-checkins
mailing list