From: Guido van Rossum Date: Sat, 13 Jan 2001 22:14:31 +0000 (+0000) Subject: mwh: [ Patch #103228 ] traceback.py nit. X-Git-Tag: v2.1a1~300 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ad167ae34f47328c9054cea33edea3d5b2011bd;p=python mwh: [ Patch #103228 ] traceback.py nit. When the exception has no message, don't insert a colon after the exception name. --- 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):