[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

Marco Buttu report at bugs.python.org
Fri Feb 12 08:53:24 EST 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue26182>
_______________________________________


More information about the Python-bugs-list mailing list