[wingide-users] querying debug?

Michael Foord fuzzyman at voidspace.org.uk
Sat Feb 21 09:59:35 MST 2009

Wingware Support wrote:
> Hamish McKenzie wrote:
>> is there any way I can determine whether I’m running a script under 
>> debug in wing?
>> what I want to do is turn on an exception handler if I’m not running 
>> under debug in wing, but if I am, I don’t want exceptions handled. 
>> it’s a pain having to remember to comment the excepthook assignment 
>> when debugging as I usually forget to uncomment it when checking in...
> You can check it like this:
> import os
> if os.environ.has_key('WINGDB_ACTIVE'):
> print "debugging"

Come on Stephan, has_key is deprecated - you know that. ;-)

if 'WINGDB_ACTIVE' in os.environ:

All the best,



More information about the wingide-users mailing list