[Python-checkins] CVS: python/dist/src/Doc/api exceptions.tex,1.2,1.3

Fred L. Drake fdrake@users.sourceforge.net
Mon, 03 Dec 2001 09:56:15 -0800


Update of /cvsroot/python/python/dist/src/Doc/api
In directory usw-pr-cvs1:/tmp/cvs-serv21590/api

Modified Files:
	exceptions.tex 
Log Message:
Clarify that the Python runtime may behave mysteriously when an exception
is not handled properly.
This closes SF bug #485153.


Index: exceptions.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/exceptions.tex,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** exceptions.tex	2001/12/03 16:36:43	1.2
--- exceptions.tex	2001/12/03 17:56:09	1.3
***************
*** 9,17 ****
  failure.  Most functions also return an error indicator, usually
  \NULL{} if they are supposed to return a pointer, or \code{-1} if they
! return an integer (exception: the \cfunction{PyArg_Parse*()} functions
! return \code{1} for success and \code{0} for failure).  When a
! function must fail because some function it called failed, it
  generally doesn't set the error indicator; the function it called
! already set it.
  
  The error indicator consists of three Python objects corresponding to
--- 9,25 ----
  failure.  Most functions also return an error indicator, usually
  \NULL{} if they are supposed to return a pointer, or \code{-1} if they
! return an integer (exception: the \cfunction{PyArg_*()} functions
! return \code{1} for success and \code{0} for failure).
! 
! When a function must fail because some function it called failed, it
  generally doesn't set the error indicator; the function it called
! already set it.  It is responsible for either handling the error and
! clearing the exception or returning after cleaning up any resources it
! holds (such as object references or memory allocations); it should
! \emph{not} continue normally if it is not prepared to handle the
! error.  If returning due to an error, it is important to indicate to
! the caller that an error has been set.  If the error is not handled or
! carefully propogated, additional calls into the Python/C API may not
! behave as intended and may fail in mysterious ways.
  
  The error indicator consists of three Python objects corresponding to