[Bf-python] Can't use Python sets in Blender 2.40

Martin Poirier theeth at yahoo.com
Sat Dec 24 14:50:53 CET 2005



--- Stephen Swaney <sswaney at centurytel.net> wrote:

> I'm too lazy to look - and it's much more fun to
> speculate! - but
> I'm guessing that we do not provide the sets module
> for Windos
> because we try to maintain Py 2.3 compatibility. 
> Hence, the import
> fails.

sets isn't a builtin module, it's in /lib of the
python install, so we don't control that.

--- Campbell Barton <cbarton at metavr.com> wrote:

> Why not do a...
> try:
>   dummyset = set() # python 2.4
>   del dummyset
> except:
>   try:
>     improt sets
>     set  = sets.set
>   except:
>     raise 'for this script to run a Blender compiled
> with python 2.4 or 
> a full python 2.3 install is required.

probably faster to do it like that (no del, so no
directory insert and remove):

try:
    set()
except:
    try:
        import sets
        set = sets.Set # upper case name to lower case
    except:
        raise EnvironmentError("For versions of
Blender using Python 2.3, this script requires a full
Python installation")

Also, isn't OS X, the only Blender version still using
Python 2.3? If that's the case, no need to test the
import, OS X always has a full Python.

Martin


		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 




More information about the Bf-python mailing list