> try:
> import foo
> except ImportError:
> logging.error('could not import foo')
> sys.exit(1)
Why not just let the exception terminate the program? It will have even more
information about the problem that caused foo not to load.
--
http://mail.python.org/mailman/listinfo/python-list
- Handling import errors Guillaume Martel-Genest
- Re: Handling import errors Tim Johnson
- Handling import errors Guillaume Martel-Genest
- Re: Handling import errors Miki Tebeka
- Re: Handling import errors Mel
- Re: Handling import errors Chris Rebert
- Re: Handling import errors Guillaume Martel-Genest
