bug/poor tracebacks while importing code

Fernando Pérez fperez528 at yahoo.com
Wed Oct 2 15:03:03 EDT 2002


Robin Becker wrote:


> The underlying problem is that I want to determine the python machine
> instruction that caused a bootstrap __init__.py to be imported as I wish
> to transparently cause a different package to be substituted. I can do
> this if the import is of the form 'import a', but not obviously if it is
> 'import a.sub_a' or 'from a import sub_a' etc as I require to repeat the
> required import with my __import__ magic in place.

[snipped details...]

Well, you seem to have a trickier problem in hand than I originally 
interpreted from the first posting. Probably others here can come up with 
better solutions.

Good luck,

f.



More information about the Python-list mailing list