Commit 3ad167ae authored by Guido van Rossum's avatar Guido van Rossum

mwh: [ Patch #103228 ] traceback.py nit.

When the exception has no message, don't insert a colon after the
exception name.
parent 4ec59c75
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment