diff options
author | Guido van Rossum <guido@python.org> | 2001-01-13 22:14:31 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-01-13 22:14:31 +0000 |
commit | 5e8a40475bd00ac8246506d68faf3ffb7628755d (patch) | |
tree | 23820986c6e995c7b6b70258514604b27d78c600 /Lib/traceback.py | |
parent | cf0b7e82ecbcbb7bd904ad0c8dd5757f31dcf97f (diff) | |
download | cpython-5e8a40475bd00ac8246506d68faf3ffb7628755d.tar.gz |
mwh: [ Patch #103228 ] traceback.py nit.
When the exception has no message, don't insert a colon after the
exception name.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index b733598f25..064712e6c2 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -166,7 +166,11 @@ def format_exception_only(etype, value): s = s + ' ' list.append('%s^\n' % s) value = msg - list.append('%s: %s\n' % (str(stype), _some_str(value))) + s = _some_str(value) + if s: + list.append('%s: %s\n' % (str(stype), s)) + else: + list.append('%s\n' % str(stype)) return list def _some_str(value): |