Bugs item #1543306, was opened at 2006-08-19 19:16 Message generated for change (Comment added) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1543306&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parser/Compiler Group: Python 2.4 >Status: Closed >Resolution: Wont Fix Priority: 3 Private: No Submitted By: daniel hahler (blueyed) >Assigned to: Neal Norwitz (nnorwitz) Summary: "from __future__ import foobar;" causes wrong SyntaxError Initial Comment: Instead of "SyntaxError: future feature foobar is not defined", you will get "SyntaxError: from __future__ imports must occur at the beginning of the file", if you use a semicolon at the end of the line (which is valid for existing future-imports of course). Python 2.4.3 (#2, Apr 27 2006, 14:43:58) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from __future__ import foobar; File "<stdin>", line 1 SyntaxError: from __future__ imports must occur at the beginning of the file >>> from __future__ import generators; >>> ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2006-10-28 15:58 Message: Logged In: YES user_id=33168 As Georg noted, this is fixed in 2.5. 2.4 is no longer supported. ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2006-08-20 07:33 Message: Logged In: YES user_id=849994 The 2.5+ AST compiler gives the correct error message. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1543306&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com