[issue12216] future imports change the reporting of syntaxerrors

Ronny Pfannschmidt report at bugs.python.org
Mon May 30 16:54:57 CEST 2011


New submission from Ronny Pfannschmidt <ronny.pfannschmidt at gmail.com>:

>>> compile('def foo(', '', 'exec')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 1
    def foo(
          ^
SyntaxError: unexpected EOF while parsing

vs

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

----------
messages: 137285
nosy: Ronny.Pfannschmidt
priority: normal
severity: normal
status: open
title: future imports change the reporting of syntaxerrors
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2

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


More information about the Python-bugs-list mailing list