The usual
diff --git a/Lib/dos-8x3/tracebac.py b/Lib/dos-8x3/tracebac.py
index d219340..b733598 100755
--- a/Lib/dos-8x3/tracebac.py
+++ b/Lib/dos-8x3/tracebac.py
@@ -166,9 +166,15 @@
s = s + ' '
list.append('%s^\n' % s)
value = msg
- list.append('%s: %s\n' % (str(stype), str(value)))
+ list.append('%s: %s\n' % (str(stype), _some_str(value)))
return list
+def _some_str(value):
+ try:
+ return str(value)
+ except:
+ return '<unprintable %s object>' % type(value).__name__
+
def print_exc(limit=None, file=None):
"""This is a shorthand for 'print_exception(sys.exc_type,