I think you might want the traceback module - have you looked at it?

http://docs.python.org/lib/module-traceback.html

Cheers,
Vern
Doug wrote:
> I'm interested in exploring a custom traceback error handler, but I
> can't figure out if it is possible. I'd like to do something like:
> 
> #-----------------------------
> from mylibrary import *
> x = 7 / 0
> #-----------------------------
> 
> such that I can control what happens when an unhandled exception is
> thrown. I want to put something in mylibrary. Now, I know I can:
> 
> #-----------------------------
> import sys
> try:
>    x = 7 / 0
> except:
>    custom_handler(sys.exc_type, sys.exc_value, sys.exc_traceback)
> #-----------------------------
> 
> but I don't want to surround all of my code in a try/except clause. Is
> this possible? Are there hooks into the standard interpreter's
> unhandled exception handling?
> 
> Thanks for any hints,
> 
> -Doug
> 
> 
> > 

-- 
This time for sure!
    -Bullwinkle J. Moose
-----------------------------
Vern Ceder, Director of Technology
Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804
[EMAIL PROTECTED]; 260-436-0746; FAX: 260-436-5137

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"edupython" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/edupython
-~----------~----~----~----~------~----~------~--~---

Reply via email to