Message72533
This example shows the behavior:
from warnings import catch_warnings
def test():
with catch_warnings(True) as w:
assert str(w.message) == "foo", "%r != %r" % (w.message, "foo")
test()
This fails with an IndexError from the `w.message`. That's a bit
surprising, and since this is mostly an API useful for testing, it'd be
much better if it had a well-defined, documented (ie, stable and likely
to continue working in the next release of Python) error mode. |
|
Date |
User |
Action |
Args |
2008-09-04 22:10:09 | exarkun | set | recipients:
+ exarkun |
2008-09-04 22:10:09 | exarkun | set | messageid: <1220566209.35.0.614126643007.issue3781@psf.upfronthosting.co.za> |
2008-09-04 22:10:08 | exarkun | link | issue3781 messages |
2008-09-04 22:10:08 | exarkun | create | |
|