New submission from Matt McCredie <[EMAIL PROTECTED]>:
The following session demonstrates the issue:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exec "def foo():\n return 0" # no ending newline works fine
>>> foo()
0
>>> exec "def foo():\n return 1\n" # with an ending newline works fine
>>> foo()
1
>>> from __future__ import with_statement
>>> exec "def foo():\n return 2\n" # with an ending newline works fine
>>> foo()
2
>>> exec "def foo():\n return 3" # without an ending new line... breaks
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 2
return 3
^
Possibly related to http://bugs.python.org/issue1184112, and/or
http://bugs.python.org/issue501622?
----------
components: Interpreter Core
messages: 69723
nosy: mccredie
severity: normal
status: open
title: importing with_statement causes exec to raise syntax error on block that
doesn't end with a newline
versions: Python 2.5
_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3370>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com