mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[Patch #969907] Add traceback to warning output
This commit is contained in:
parent
300ce19592
commit
ae40c2f795
1 changed files with 5 additions and 4 deletions
|
@ -49,10 +49,11 @@ def reraise_unmasked_exceptions(unmasked=()):
|
|||
if issubclass(etype, unmasked):
|
||||
raise
|
||||
# swallowed an exception
|
||||
import warnings
|
||||
warnings.warn("cookielib bug!", stacklevel=2)
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
import warnings, traceback, StringIO
|
||||
f = StringIO.StringIO()
|
||||
traceback.print_exc(None, f)
|
||||
msg = f.getvalue()
|
||||
warnings.warn("cookielib bug!\n%s" % msg, stacklevel=2)
|
||||
|
||||
|
||||
# Date/time conversion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue