diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2003-11-05 23:03:00 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2003-11-05 23:03:00 (GMT) |
commit | f607fc5395883ff924c76739e9b0921953568e54 (patch) | |
tree | b48054ff714054bf4390059345215feba4a3703b /Lib/threading.py | |
parent | 904ed86a777f5e55d370e997f8efb433052ca6e3 (diff) | |
download | cpython-f607fc5395883ff924c76739e9b0921953568e54.zip cpython-f607fc5395883ff924c76739e9b0921953568e54.tar.gz cpython-f607fc5395883ff924c76739e9b0921953568e54.tar.bz2 |
Add traceback.format_exc().
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 81a2693..c5d5af3 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -8,9 +8,8 @@ except ImportError: del _sys.modules[__name__] raise -from StringIO import StringIO as _StringIO from time import time as _time, sleep as _sleep -from traceback import print_exc as _print_exc +from traceback import format_exc as _format_exc # Rename some stuff so "from threading import *" is safe __all__ = ['activeCount', 'Condition', 'currentThread', 'enumerate', 'Event', @@ -440,10 +439,8 @@ class Thread(_Verbose): except: if __debug__: self._note("%s.__bootstrap(): unhandled exception", self) - s = _StringIO() - _print_exc(file=s) _sys.stderr.write("Exception in thread %s:\n%s\n" % - (self.getName(), s.getvalue())) + (self.getName(), _format_exc())) else: if __debug__: self._note("%s.__bootstrap(): normal return", self) |