diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-17 05:49:33 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-17 05:49:33 (GMT) |
commit | ac3625fcb95c2c54e40e1a27f2395811adbed03e (patch) | |
tree | 7ef987a510e3ad2e43ee67ca6854cd6af23673f9 /Doc/ref | |
parent | fc85c92a85e08d39ea769a07a3dc2a3c83c21477 (diff) | |
download | cpython-ac3625fcb95c2c54e40e1a27f2395811adbed03e.zip cpython-ac3625fcb95c2c54e40e1a27f2395811adbed03e.tar.gz cpython-ac3625fcb95c2c54e40e1a27f2395811adbed03e.tar.bz2 |
Remove sys.exc_type, sys.exc_value, sys.exc_traceback
Diffstat (limited to 'Doc/ref')
-rw-r--r-- | Doc/ref/ref7.tex | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Doc/ref/ref7.tex b/Doc/ref/ref7.tex index 4ae6040..90627a4 100644 --- a/Doc/ref/ref7.tex +++ b/Doc/ref/ref7.tex @@ -250,21 +250,15 @@ 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 -\module{sys}\refbimodindex{sys} module: \code{sys.exc_type} receives -the object identifying the exception; \code{sys.exc_value} receives -the exception's parameter; \code{sys.exc_traceback} receives a +exception are stored in the \module{sys}\refbimodindex{sys} module +and can be access via \function{sys.exc_info()}. \function{sys.exc_info()} +returns a 3-tuple consisting of: \code{exc_type} receives +the object identifying the exception; \code{exc_value} receives +the exception's parameter; \code{exc_traceback} receives a traceback object\obindex{traceback} (see section~\ref{traceback}) identifying the point in the program where the exception occurred. -These details are also available through the \function{sys.exc_info()} -function, which returns a tuple \code{(\var{exc_type}, \var{exc_value}, -\var{exc_traceback})}. Use of the corresponding variables is -deprecated in favor of this function, since their use is unsafe in a -threaded program. As of Python 1.5, the variables are restored to -their previous values (before the call) when returning from a function -that handled an exception. -\withsubitem{(in module sys)}{\ttindex{exc_type} - \ttindex{exc_value}\ttindex{exc_traceback}} +\function{sys.exc_info()} values are restored to their previous values +(before the call) when returning from a function that handled an exception. The optional \keyword{else} clause is executed if and when control flows off the end of the \keyword{try} clause.\footnote{ |