Safe Psyco

Aahz aahz at pythoncraft.com
Tue Oct 15 10:14:24 EDT 2002


In article <mailman.1034571499.2486.python-list at python.org>,
Delaney, Timothy <tdelaney at avaya.com> wrote:
> From: aahz at pythoncraft.com [mailto:aahz at pythoncraft.com]
>> 
>> That only works if you do *ALL* your bindings for your application in
>> one spot.  The problem is that you only get ImportError once per
>> application invocation.
>
>That would be completely broken behaviour IMO.
>
>try:
>    import abc
>except ImportError:
>    print 'Error 1'
>
>try:
>    import abc
>except ImportError:
>    print 'Error 2'

Oh, right, I was getting mixed up with the case where the module exists
but is broken.  That still might apply if someone has Psyco incorrectly
installed, but it's less likely to show up with a straightforward check
against ImportError.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Project Vote Smart: http://www.vote-smart.org/



More information about the Python-list mailing list