Graham Dumpleton wrote .. > I still need to do more investigation work on the import hook to see if > it is at all possible to override it just for specific modules, ie., > those loaded using the custom module loader. If I can find a way of > doing this, then great. If not, am always at the risk that if mod_python > were to do a similar thing that my way of doing it would stop working, > although, just had an idea how it could be done in mod_python and I > could still make use of it. :-)
Hmmm, got it working on my box so am only overriding "import" for specific modules that get imported by module loader now. Thus, isn't used outside of scope of those modules and thus less chance for problems and no chance of some other systems global import hook replacing my own. Turned out my only problem from when I tried the first time some weeks back was a lack of an "s" on "__builtins__" in the specific case where it was required. Is confusing how there is "__builtin__" and "__builtins__". :-( I'll push it into my subversion repository when I get home again if you want to look at it. Graham