summaryrefslogtreecommitdiff
path: root/Lib/logging
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-06-19 12:36:06 +0000
committerGeorg Brandl <georg@python.org>2007-06-19 12:36:06 +0000
commit23af202ba900297f4f9350c2365b78a4e6f83aa7 (patch)
treed2d04b4ebafaf840c748eb24686a8b1baae1873d /Lib/logging
parent1cd5b2eb485e675e4b68f6668c44f5b38ba6b3ad (diff)
downloadcpython-23af202ba900297f4f9350c2365b78a4e6f83aa7.tar.gz
Bug #1737864: allow empty message in logging format routines.
(backport from rev. 56038)
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index b1887dfe05..4fd582cd85 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -398,7 +398,7 @@ class Formatter:
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 @@ class Formatter:
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