dropping into the debugger on an exception

Peter Hansen peter at engcorp.com
Wed Jun 9 10:52:15 EDT 2004


Jon Perez wrote:

> Thomas Heller wrote:
> 
>> Is the description in the cookbook unclear?  You do *not* have to add
>> anything to your script - save the code as a file
>> C:\Python23\sitecustomize.py and everything will work.  And you don't
>> have to start the script from within pdb. The sitecustomize module is
>> automatically imported when Python starts - if it is found.
> 
> Yes, I'm aware of this.  I don't want to add this to sitecustomize.py
> because I don't want this happening all the time.

Just to be clear: you don't want this to happen all the time,
you want it to happen only with a particular script, yet you
don't want to modify that script at all?

Would it be sufficient to have a local sitecustomize.py file
in the directory where the script is, or do you have other
scripts in that folder which you don't want to get the same
treatment?

What about a wrapper which you invoke instead of the script,
which sets this up and then runs the real script using
"import" and an appropriate direct call?

-Peter



More information about the Python-list mailing list