Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f2b4554

Browse files
committed
Document the correct class hierarchy for SystemExit. It is not an
error and so it derives from Exception and not SystemError.
1 parent 83c03e2 commit f2b4554

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Doc/lib/libexcs.tex

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ \section{Built-in Exceptions}
1313

1414
For backward compatibility, when Python is invoked with the \code{-X}
1515
option, most of the standard exceptions are strings\footnote{For
16-
forward-compatibility the new exceptions \exception{LookupError},
16+
forward-compatibility the new exceptions \exception{Exception},
17+
\exception{LookupError},
1718
\exception{ArithmeticError}, \exception{EnvironmentError}, and
1819
\exception{StandardError} are tuples.}. This option may be used to
1920
run code that breaks because of the different semantics of class based
@@ -76,8 +77,9 @@ \section{Built-in Exceptions}
7677
\end{excdesc}
7778

7879
\begin{excdesc}{StandardError}
79-
The base class for built-in exceptions. All built-in exceptions are
80-
derived from this class, which is itself derived from the root class
80+
The base class for all built-in exceptions except
81+
\exception{SystemExit}. \exception{StandardError} itself is derived
82+
from the root class
8183
\exception{Exception}.
8284
\end{excdesc}
8385

@@ -288,7 +290,9 @@ \section{Built-in Exceptions}
288290

289291
When class exceptions are used, the instance has an attribute
290292
\member{code} which is set to the proposed exit status or error message
291-
(defaulting to \code{None}).
293+
(defaulting to \code{None}). Also, this exception derives directly
294+
from \exception{Exception} and not \exception{StandardError}, since it
295+
is not technically an error.
292296

293297
A call to \function{sys.exit()} is translated into an exception so that
294298
clean-up handlers (\keyword{finally} clauses of \keyword{try} statements)

0 commit comments

Comments
 (0)