[Python-checkins] python/dist/src/Doc/lib libsys.tex,1.61,1.62
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Fri, 28 Feb 2003 19:21:11 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv29053/Doc/lib
Modified Files:
libsys.tex
Log Message:
- New function sys.exc_clear() clears the current exception. This is
rarely needed, but can sometimes be useful to release objects
referenced by the traceback held in sys.exc_info()[2]. (SF patch
#693195.) Thanks to Kevin Jacobs!
Index: libsys.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsys.tex,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** libsys.tex 8 Oct 2002 02:44:29 -0000 1.61
--- libsys.tex 1 Mar 2003 03:20:38 -0000 1.62
***************
*** 100,103 ****
--- 100,108 ----
originally occurred. \obindex{traceback}
+ If \function{exc_clear()} is called, this function will return three
+ \code{None} values until either another exception is raised in the
+ current thread or the execution stack returns to a frame where
+ another exception is being handled.
+
\warning{Assigning the \var{traceback} return value to a
local variable in a function that is handling an exception will
***************
*** 114,117 ****
--- 119,137 ----
collection is enabled and they become unreachable, but it remains more
efficient to avoid creating cycles.}
+ \end{funcdesc}
+
+ \begin{funcdesc}{exc_clear}{}
+ This function clears all information relating to the current or last
+ exception that occured in the current thread. After calling this
+ function, \function{exc_info()} will return three \code{None} values until
+ another exception is raised in the current thread or the execution stack
+ returns to a frame where another exception is being handled.
+
+ This function is only needed in only a few obscure situations. These
+ include logging and error handling systems that report information on the
+ last or current exception. This function can also be used to try to free
+ resources and trigger object finalization, though no guarantee is made as
+ to what objects will be freed, if any.
+ \versionadded{2.3}
\end{funcdesc}