diff options
author | Georg Brandl <georg@python.org> | 2007-06-19 12:36:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-06-19 12:36:00 (GMT) |
commit | 75ec1dbd9d06de1239ee04c020c8db8af6cd18d6 (patch) | |
tree | e2b64423cf453a408f85b0ec04fbd3393d1a6da1 /Lib/logging | |
parent | 072aaf7150eef204a686b945fc71647f69723b88 (diff) | |
download | cpython-75ec1dbd9d06de1239ee04c020c8db8af6cd18d6.zip cpython-75ec1dbd9d06de1239ee04c020c8db8af6cd18d6.tar.gz cpython-75ec1dbd9d06de1239ee04c020c8db8af6cd18d6.tar.bz2 |
Bug #1737864: allow empty message in logging format routines.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 321e118..d667b73 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 |