diff options
author | Barry Warsaw <barry@python.org> | 1999-02-24 00:27:14 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1999-02-24 00:27:14 (GMT) |
commit | f2b4554403f42307c4543de44436db118dbd0cde (patch) | |
tree | e3433a5766fbaa7360fa52945c28d6ed29346498 | |
parent | 83c03e2d94da97e715b18c29e27a553832b09065 (diff) | |
download | cpython-f2b4554403f42307c4543de44436db118dbd0cde.zip cpython-f2b4554403f42307c4543de44436db118dbd0cde.tar.gz cpython-f2b4554403f42307c4543de44436db118dbd0cde.tar.bz2 |
Document the correct class hierarchy for SystemExit. It is not an
error and so it derives from Exception and not SystemError.
-rw-r--r-- | Doc/lib/libexcs.tex | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/lib/libexcs.tex b/Doc/lib/libexcs.tex index 8c15a95..2ff64a3 100644 --- a/Doc/lib/libexcs.tex +++ b/Doc/lib/libexcs.tex @@ -13,7 +13,8 @@ exceptions is present in the standard library module For backward compatibility, when Python is invoked with the \code{-X} option, most of the standard exceptions are strings\footnote{For -forward-compatibility the new exceptions \exception{LookupError}, +forward-compatibility the new exceptions \exception{Exception}, +\exception{LookupError}, \exception{ArithmeticError}, \exception{EnvironmentError}, and \exception{StandardError} are tuples.}. This option may be used to run code that breaks because of the different semantics of class based @@ -76,8 +77,9 @@ also available on the instance's \member{args} attribute, as a tuple. \end{excdesc} \begin{excdesc}{StandardError} -The base class for built-in exceptions. All built-in exceptions are -derived from this class, which is itself derived from the root class +The base class for all built-in exceptions except +\exception{SystemExit}. \exception{StandardError} itself is derived +from the root class \exception{Exception}. \end{excdesc} @@ -288,7 +290,9 @@ For class exceptions, \function{str()} returns only the message. When class exceptions are used, the instance has an attribute \member{code} which is set to the proposed exit status or error message -(defaulting to \code{None}). +(defaulting to \code{None}). Also, this exception derives directly +from \exception{Exception} and not \exception{StandardError}, since it +is not technically an error. A call to \function{sys.exit()} is translated into an exception so that clean-up handlers (\keyword{finally} clauses of \keyword{try} statements) |