[issue31852] Crashes with lines of the form "async \"

STINNER Victor report at bugs.python.org
Tue Oct 31 07:01:46 EDT 2017


STINNER Victor <victor.stinner at gmail.com> added the comment:

> Would it also be the case for 'await' ?

"async" requires to maintain a "async_def" state. It seems like await doesn't need a state for itself, but rely on the "async_def" state which has been fixed.

Extract of Parser/tokenizer.c:

            /* Current token length is 5. */
            if (tok->async_def) {
                /* We're inside an 'async def' function. */
                if (memcmp(tok->start, "async", 5) == 0) {
                    return ASYNC;
                }
                if (memcmp(tok->start, "await", 5) == 0) {
                    return AWAIT;
                }
            }

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31852>
_______________________________________


More information about the Python-bugs-list mailing list