[issue12216] future imports change the reporting of syntaxerrors

Benjamin Peterson report at bugs.python.org
Mon May 30 17:27:13 CEST 2011


Benjamin Peterson <benjamin at python.org> added the comment:

Actually anything before the last statement will cause this

>>> compile("\ndef foo(", '', 'exec')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 2
    def foo(
           ^
SyntaxError: invalid syntax

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12216>
_______________________________________


More information about the Python-bugs-list mailing list