Hi,
My python program has an extension system where the extension can have
a optional magic python modules. Meaning if the extension module
exists, the program will use it and if not, it will continue without
the module. So my program tests if a module exists, if so use it,
otherwise continue. Thi
On Sat, Nov 6, 2010 at 11:35 AM, Chris Rebert wrote:
> Here's what I came up with:
>
> try:
> import extension_magic_module
> except ImportError as err:
> if err.message != "No module named extension_magic_module":
> raise err
> else:
> handle_extension_magic_module()
>
It seems
On Sat, Nov 6, 2010 at 1:52 PM, Roy Smith wrote:
>
> import sys
> try:
> import xx
> except ImportError:
> tb = sys.exc_traceback
> while tb:
> print tb
> tb = tb.tb_next
>
I went ahead and implemented this and it now works. I even uncovered a
bug I wasn't previously seeing
On Tue, Nov 9, 2010 at 4:30 AM, Roy Smith wrote:
> In article ,
> Lawrence D'Oliveiro wrote:
>
>> In message , Roy Smith wrote:
>>
>> > On the other hand, if your module's bug is that it in turn imports some
>> > other module, which doesn't exist, you'll also get an ImportError.
>>
>> Does it re
On Mon, Nov 8, 2010 at 11:35 PM, Lawrence D'Oliveiro
wrote:
> In message , Roy Smith wrote:
>
>> On the other hand, if your module's bug is that it in turn imports some
>> other module, which doesn't exist, you'll also get an ImportError.
>
> Does it really matter? Either way, the module is unusab
On Wed, Nov 10, 2010 at 1:50 AM, Lawrence D'Oliveiro
wrote:
> In message , Jon
> Dufresne wrote:
>
>> On Mon, Nov 8, 2010 at 11:35 PM, Lawrence D'Oliveiro ...
>
> I see that you published my unobfuscated e-mail address on USENET for all to
> see. I obfuscated it