[wingide-users] import hook problems

Wingware Support support at wingware.com
Wed Nov 8 09:51:29 MST 2006


On Wed, 8 Nov 2006, Maciej Fijalkowski wrote:
> 1. Make debugger hook call previous debugger hook in some circumstances
> (like importing py.)
> 2. Making an option to disable it
> 
> Any other ideas how can I support in from library side?

Using wingdbstub and importing that after pylib has set its 
import hook may solve your problem.  This requires launching your 
code from the command line and not from the IDE.  See 
http://wingware.com/doc/debug/debugging-externally-launched-code
for more info.

Or, change pylib to call whatever import hook was in place before 
its hook was installed.  It really should do that anyway when 
importing something other than its own magic modules.

Be aware that presence of any import magic may mean Wing won't be 
able to find the modules' source code or correctly identify 
breakpoints, but it depends on how it's done.  In short, the 
source needs to be available on disk and the __file__ module 
attribute or co_filename in the code objects should be set 
to the full path to the source file.

By chance, I'm working on the debugger code now and I'm pretty 
sure removing our import hook entirely won't really work right.  
I'll keep this in mind, though.

Hope that helps.

Stephan Deibel

--
Wingware
Wing IDE for Python
Advancing Software Development

www.wingware.com


More information about the wingide-users mailing list