[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

Matthias Bussonnier report at bugs.python.org
Fri Nov 12 12:54:34 EST 2021


Matthias Bussonnier <bussonniermatthias at gmail.com> added the comment:

Note that with the following example, exec and CommandCompiler return a different error:

    from codeop import CommandCompiler

    # identical errors
    #exec('1,\\#\n2') SystemError
    #CommandCompiler()('1,\\#\n2', symbol='exec') SystemError

    # one is syntax the other is System.
    exec('a \ \n')  # SyntaxError
    CommandCompiler()('a \ \n', symbol='exec') # SystemError

----------

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


More information about the Python-bugs-list mailing list