[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

Brett Cannon report at bugs.python.org
Sun Sep 7 23:29:17 CEST 2008


Brett Cannon <brett at python.org> added the comment:

The new patch ditches the WarningsRecorder class and just returns a list
that is directly mutated. I also removed all uses of
test.test_support.catch_warning() and moved them over. Docs have been
thoroughly updated to give example usage. And lastly, I fixed bsddb to
use catch_warnings() where it was blindly resetting the warnings filter.
It still sets a filter at the top of the module, but I didn't want to
have to search for all potential places where catch_warnings() would
have been needed.

Added file: http://bugs.python.org/file11416/clean_up_catch_warnings.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3781>
_______________________________________


More information about the Python-bugs-list mailing list