Message75113
| Author |
exarkun |
| Recipients |
exarkun |
| Date |
2008年10月22日.21:49:30 |
| SpamBayes Score |
4.7812136e-06 |
| Marked as misclassified |
No |
| Message-id |
<1224712172.47.0.998538899646.issue4180@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|