summaryrefslogtreecommitdiffstats
path: root/Lib/cookielib.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2004-07-10 18:32:12 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2004-07-10 18:32:12 (GMT)
commitae40c2f795c038abbc5e6df05f050f3d8154c4a7 (patch)
tree7559276edf3282266471e9bda424f702652654a3 /Lib/cookielib.py
parent300ce195920942926bcaee7dda765a27c4f7cf65 (diff)
downloadcpython-ae40c2f795c038abbc5e6df05f050f3d8154c4a7.zip
cpython-ae40c2f795c038abbc5e6df05f050f3d8154c4a7.tar.gz
cpython-ae40c2f795c038abbc5e6df05f050f3d8154c4a7.tar.bz2
[Patch #969907] Add traceback to warning output
Diffstat (limited to 'Lib/cookielib.py')
-rw-r--r--Lib/cookielib.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/cookielib.py b/Lib/cookielib.py
index f2cc132..a5e84e3 100644
--- a/Lib/cookielib.py
+++ b/Lib/cookielib.py
@@ -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