Message75113
If a warning is emitted then a filter with the "always" rule is added
then the is emitted again, it will not be shown the second time:
exarkun@charm:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> def f():
... warnings.warn("foo")
...
>>> f()
/home/exarkun/.pythonstartup.py:2: UserWarning: foo
>>> warnings.simplefilter("always")
>>> f()
>>>
The "always" filter is documented as "always print matching warnings"
which is contrary to this behavior. Also, the string "always" strongly
implies that it will be shown the second time. |
|
Date |
User |
Action |
Args |
2008-10-22 21:49:32 | exarkun | set | recipients:
+ exarkun |
2008-10-22 21:49:32 | exarkun | set | messageid: <1224712172.47.0.998538899646.issue4180@psf.upfronthosting.co.za> |
2008-10-22 21:49:31 | exarkun | link | issue4180 messages |
2008-10-22 21:49:30 | exarkun | create | |
|