summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/traceback.py6
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):