Why did someone write this?

skip at pobox.com skip at pobox.com
Fri Apr 7 13:02:54 EDT 2006


    Sandra> try:
    Sandra>    exc_type, exc_value, exc_traceback = sys.exc_info()
    Sandra>    # Do something
    Sandra> finally:
    Sandra>    exc_traceback = None

    Sandra> Why the try/finally with setting exc_traceback to None?

The intent is to decrement the reference count to any objects referenced by
exc_traceback.  Without it, the frame(s) referenced by the traceback remain
alive until exc_traceback goes out of scope.

Skip




More information about the Python-list mailing list