From 3ad167ae34f47328c9054cea33edea3d5b2011bd Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sat, 13 Jan 2001 22:14:31 +0000 Subject: mwh: [ Patch #103228 ] traceback.py nit. When the exception has no message, don't insert a colon after the exception name. --- Lib/traceback.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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): -- cgit v0.12