diff options
author | Guido van Rossum <guido@python.org> | 2001-01-13 22:14:31 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-01-13 22:14:31 (GMT) |
commit | 3ad167ae34f47328c9054cea33edea3d5b2011bd (patch) | |
tree | 2c60cfc6e041471f82b0283480e019c1a7ed3d9c | |
parent | 4ec59c75e30e31e9b3e9b90f66d86d8a08a1f846 (diff) | |
download | cpython-3ad167ae34f47328c9054cea33edea3d5b2011bd.zip cpython-3ad167ae34f47328c9054cea33edea3d5b2011bd.tar.gz cpython-3ad167ae34f47328c9054cea33edea3d5b2011bd.tar.bz2 |
mwh: [ Patch #103228 ] traceback.py nit.
When the exception has no message, don't insert a colon after the
exception name.
-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 b733598..064712e 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): |