Message104610
The attached patch fixes the OP's use case on the Python side by re-ordering the tests, such that "always" prevents the short-circuit from firing::
$ ./python
Python 2.6.5+ (release26-maint, Apr 29 2010, 21:24:12)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings as o_warnings
>>> import sys
>>> sys.modules['_warnings'] = 0
>>> del sys.modules['warnings']
>>> import warnings as py_warnings
>>> def f():
... py_warnings.warn('foo')
...
>>> f()
__main__:2: UserWarning: foo
>>> f()
>>> py_warnings.simplefilter('always')
>>> f()
__main__:2: UserWarning: foo
>>> f()
__main__:2: UserWarning: foo |
|
Date |
User |
Action |
Args |
2010-04-30 02:39:15 | tseaver | set | recipients:
+ tseaver, brett.cannon, exarkun, mark.dickinson, pitrou, benjamin.peterson, flox |
2010-04-30 02:39:15 | tseaver | set | messageid: <1272595155.16.0.764651452625.issue4180@psf.upfronthosting.co.za> |
2010-04-30 02:39:13 | tseaver | link | issue4180 messages |
2010-04-30 02:39:12 | tseaver | create | |
|