Marco Buttu added the comment:
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
----------
keywords: +patch
Added file: http://bugs.python.org/file41908/async_await.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26182>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com