[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: the equivalent of python's "try import <something> except: import fallback" ?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 17 Feb 2007 01:42:22 -0200
I think you want can do what you want by either calling package.loadlib
by hand (and then you'll have to try the paths, effectively reproducing
what require does but avoiding raising an error) or by adding a loader
that fakes success and registers failure somewhere else; perhaps you can
even have it convince require to return nil or false for instance.
I'm sorry for the hand waving but I hope you get the idea :-(
--lhf