diff options
author | Guido van Rossum <guido@python.org> | 2000-09-01 19:25:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-09-01 19:25:51 (GMT) |
commit | 8d691c842289cf4453f282637765f07113a7cc17 (patch) | |
tree | 3a7819d53d7578cf728d3bcfecba7daebb6981db /Lib/dos-8x3/tracebac.py | |
parent | 29201d490511b2af863e07fdf5cb247fc9117c2f (diff) | |
download | cpython-8d691c842289cf4453f282637765f07113a7cc17.zip cpython-8d691c842289cf4453f282637765f07113a7cc17.tar.gz cpython-8d691c842289cf4453f282637765f07113a7cc17.tar.bz2 |
The usual
Diffstat (limited to 'Lib/dos-8x3/tracebac.py')
-rwxr-xr-x | Lib/dos-8x3/tracebac.py | 8 |
1 files changed, 7 insertions, 1 deletions
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 @@ def format_exception_only(etype, value): 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, |