Conditional Import
Aahz
aahz at pythoncraft.com
Thu Mar 14 13:46:56 EST 2002
In article <mailman.1016126245.18593.python-list at python.org>,
Gustavo Cordova <gcordova at hebmex.com> wrote:
>
> from exceptions import ImportError
> try:
> from codeop import CommandCompiler
> except ImportError:
> from MockCommandCompiler import CommandCompiler
Exceptions are automatically imported; no need for the first line.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
The best way to get information on Usenet is not to ask a question, but
to post the wrong information. --Aahz
More information about the Python-list
mailing list