Kaydet (Commit) ae40c2f7 authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

[Patch #969907] Add traceback to warning output

üst 300ce195
...@@ -49,10 +49,11 @@ def reraise_unmasked_exceptions(unmasked=()): ...@@ -49,10 +49,11 @@ def reraise_unmasked_exceptions(unmasked=()):
if issubclass(etype, unmasked): if issubclass(etype, unmasked):
raise raise
# swallowed an exception # swallowed an exception
import warnings import warnings, traceback, StringIO
warnings.warn("cookielib bug!", stacklevel=2) f = StringIO.StringIO()
import traceback traceback.print_exc(None, f)
traceback.print_exc() msg = f.getvalue()
warnings.warn("cookielib bug!\n%s" % msg, stacklevel=2)
# Date/time conversion # Date/time conversion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment