[Python-checkins] r56039 - python/branches/release25-maint/Lib/logging/__init__.py

georg.brandl python-checkins at python.org
Tue Jun 19 14:36:08 CEST 2007


Author: georg.brandl
Date: Tue Jun 19 14:36:06 2007
New Revision: 56039

Modified:
   python/branches/release25-maint/Lib/logging/__init__.py
Log:
Bug #1737864: allow empty message in logging format routines.
 (backport from rev. 56038)

Modified: python/branches/release25-maint/Lib/logging/__init__.py
==============================================================================
--- python/branches/release25-maint/Lib/logging/__init__.py	(original)
+++ python/branches/release25-maint/Lib/logging/__init__.py	Tue Jun 19 14:36:06 2007
@@ -398,7 +398,7 @@
         traceback.print_exception(ei[0], ei[1], ei[2], None, sio)
         s = sio.getvalue()
         sio.close()
-        if s[-1] == "\n":
+        if s[-1:] == "\n":
             s = s[:-1]
         return s
 
@@ -425,7 +425,7 @@
             if not record.exc_text:
                 record.exc_text = self.formatException(record.exc_info)
         if record.exc_text:
-            if s[-1] != "\n":
+            if s[-1:] != "\n":
                 s = s + "\n"
             s = s + record.exc_text
         return s


More information about the Python-checkins mailing list