Message260177
Thank you Brett, the problem was the missed exec(). With the patch in attachment the tests pass, but it does not seem to me a good solution. Infact, changing the filter at runtime has no effect:
$ cat foo.py
import warnings
warnings.simplefilter("always")
async = 33
await = 33
$ ./python foo.py
$
Does this happen because, putting the PyErr_WarnEx() in Python/ast.c, the warning is issued before the runtime?
Furthermore, if I set the filter from the CL, then the warning is properly triggered, but the file name and line number are wrong:
$ ./python -Wd foo.py
sys:1: DeprecationWarning: 'async' will become a reserved keyword in Python 3.7
sys:1: DeprecationWarning: 'await' will become a reserved keyword in Python 3.7 |
|
Date |
User |
Action |
Args |
2016-02-12 13:53:24 | marco.buttu | set | recipients:
+ marco.buttu, gvanrossum, brett.cannon, giampaolo.rodola, yselivanov, anish.shah |
2016-02-12 13:53:24 | marco.buttu | set | messageid: <1455285204.8.0.0672113107652.issue26182@psf.upfronthosting.co.za> |
2016-02-12 13:53:24 | marco.buttu | link | issue26182 messages |
2016-02-12 13:53:24 | marco.buttu | create | |
|