Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > __future__ and compile: unrecognised flags

Thread Tools

__future__ and compile: unrecognised flags

Poor Yorick
Posts: n/a
I have a future statement in a script which is intended to work in 2.6 and 3.
Shouldn't compile flags in __future__ objects essentially be noops for versions
that already support the feature? doctest is complaining about unrecognised
flags. This illustrates the problem:

Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import unicode_literals
>>> src = 'a = "hello"'
>>> c1 = compile(src,'<string>','exec', piler_flag)

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: compile(): unrecognised flags

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Funny behaviour with __future__ and doctest between 2.6 and 3.1 Mattsteel Python 4 01-30-2010 10:25 AM
timeit and __future__ Karl Chen Python 1 06-20-2009 01:39 PM
Re: Quetion about flags of socket.recv(bufsize, [flags]) Steve Holden Python 0 02-08-2009 04:09 PM
Re: __future__ and compile: unrecognised flags Steve Holden Python 1 12-14-2008 08:46 AM
__future__ and unrecognised flags Poor Yorick Python 0 12-12-2008 09:52 PM