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

Brett Cannon report at bugs.python.org
Fri Sep 5 06:12:00 CEST 2008


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

The attached patch has WarningsRecorder raise AttributeError when there
is no recorded attribute and yet one tries to access warnings attributes.

And just so you know, JP, make sure to use keyword arguments when
calling catch_warnings() (in case you didn't notice the note in the
docs). In Py3K they are keyword-only.

----------
assignee: brett.cannon -> 
keywords: +needs review, patch
Added file: http://bugs.python.org/file11382/catch_warnings_atts.diff

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


More information about the Python-bugs-list mailing list