diff options
author | Guido van Rossum <guido@python.org> | 1993-10-11 12:54:58 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-10-11 12:54:58 (GMT) |
commit | 7f8765d327c9e8634da1f4d6f792897fbba216f6 (patch) | |
tree | c2f50746f2dee580bd6377ff7af2aff54ae19bcd /Doc/ref7.tex | |
parent | a9c3c22c33762699b362e7598268442fd2df9eb6 (diff) | |
download | cpython-7f8765d327c9e8634da1f4d6f792897fbba216f6.zip cpython-7f8765d327c9e8634da1f4d6f792897fbba216f6.tar.gz cpython-7f8765d327c9e8634da1f4d6f792897fbba216f6.tar.bz2 |
* ref3.tex: added cross-ref to try statement for exc handler.
* ref7.tex: added description of sys.exc_{type,value,traceback}.
* lib5.tex: rect.intersect is different now!
Diffstat (limited to 'Doc/ref7.tex')
-rw-r--r-- | Doc/ref7.tex | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Doc/ref7.tex b/Doc/ref7.tex index 357bd5f..0f96c82 100644 --- a/Doc/ref7.tex +++ b/Doc/ref7.tex @@ -172,7 +172,7 @@ for x in a[:]: if x < 0: a.remove(x) \end{verbatim} -\section{The {\tt try} statement} +\section{The {\tt try} statement} \label{try} \stindex{try} The \verb\try\ statement specifies exception handlers and/or cleanup @@ -222,6 +222,19 @@ statement. (This means that if two nested handlers exist for the same exception, and the exception occurs in the try clause of the inner handler, the outer handler will not handle the exception.) +Before an except clause's suite is executed, details about the +exception are assigned to three variables in the \verb\sys\ module: +\verb\sys.exc_type\ receives the object identifying the exception; +\verb\sys.exc_value\ receives the exception's parameter; +\verb\sys.exc_traceback\ receives a traceback object (see section +\ref{traceback}) identifying the point in the program where the +exception occurred. +\bimodindex{sys} +\ttindex{exc_type} +\ttindex{exc_value} +\ttindex{exc_traceback} +\obindex{traceback} + The \verb\try...finally\ form specifies a `cleanup' handler. The \verb\try\ clause is executed. When no exception occurs, the \verb\finally\ clause is executed. When an exception occurs in the |