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

Skip to content

Commit 7f8765d

Browse files
committed
* 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!
1 parent a9c3c22 commit 7f8765d

4 files changed

Lines changed: 34 additions & 6 deletions

File tree

Doc/ref/ref3.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,13 @@ \section{The standard type hierarchy} \label{types}
532532
\ttindex{f_lineno}
533533
\ttindex{f_lasti}
534534

535-
\item[Traceback objects]
535+
\item[Traceback objects] \label{traceback}
536536
Traceback objects represent a stack trace of an exception. A
537537
traceback object is created when an exception occurs. When the search
538538
for an exception handler unwinds the execution stack, at each unwound
539539
level a traceback object is inserted in front of the current
540-
traceback. When an exception handler is entered, the stack trace is
540+
traceback. When an exception handler is entered
541+
(see also section \ref{try}), the stack trace is
541542
made available to the program as \verb\sys.exc_traceback\. When the
542543
program contains no suitable handler, the stack trace is written
543544
(nicely formatted) to the standard error stream; if the interpreter is

Doc/ref/ref7.tex

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ \section{The {\tt for} statement}
172172
if x < 0: a.remove(x)
173173
\end{verbatim}
174174

175-
\section{The {\tt try} statement}
175+
\section{The {\tt try} statement} \label{try}
176176
\stindex{try}
177177

178178
The \verb\try\ statement specifies exception handlers and/or cleanup
@@ -222,6 +222,19 @@ \section{The {\tt try} statement}
222222
exception, and the exception occurs in the try clause of the inner
223223
handler, the outer handler will not handle the exception.)
224224

225+
Before an except clause's suite is executed, details about the
226+
exception are assigned to three variables in the \verb\sys\ module:
227+
\verb\sys.exc_type\ receives the object identifying the exception;
228+
\verb\sys.exc_value\ receives the exception's parameter;
229+
\verb\sys.exc_traceback\ receives a traceback object (see section
230+
\ref{traceback}) identifying the point in the program where the
231+
exception occurred.
232+
\bimodindex{sys}
233+
\ttindex{exc_type}
234+
\ttindex{exc_value}
235+
\ttindex{exc_traceback}
236+
\obindex{traceback}
237+
225238
The \verb\try...finally\ form specifies a `cleanup' handler. The
226239
\verb\try\ clause is executed. When no exception occurs, the
227240
\verb\finally\ clause is executed. When an exception occurs in the

Doc/ref3.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,13 @@ \section{The standard type hierarchy} \label{types}
532532
\ttindex{f_lineno}
533533
\ttindex{f_lasti}
534534

535-
\item[Traceback objects]
535+
\item[Traceback objects] \label{traceback}
536536
Traceback objects represent a stack trace of an exception. A
537537
traceback object is created when an exception occurs. When the search
538538
for an exception handler unwinds the execution stack, at each unwound
539539
level a traceback object is inserted in front of the current
540-
traceback. When an exception handler is entered, the stack trace is
540+
traceback. When an exception handler is entered
541+
(see also section \ref{try}), the stack trace is
541542
made available to the program as \verb\sys.exc_traceback\. When the
542543
program contains no suitable handler, the stack trace is written
543544
(nicely formatted) to the standard error stream; if the interpreter is

Doc/ref7.tex

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ \section{The {\tt for} statement}
172172
if x < 0: a.remove(x)
173173
\end{verbatim}
174174

175-
\section{The {\tt try} statement}
175+
\section{The {\tt try} statement} \label{try}
176176
\stindex{try}
177177

178178
The \verb\try\ statement specifies exception handlers and/or cleanup
@@ -222,6 +222,19 @@ \section{The {\tt try} statement}
222222
exception, and the exception occurs in the try clause of the inner
223223
handler, the outer handler will not handle the exception.)
224224

225+
Before an except clause's suite is executed, details about the
226+
exception are assigned to three variables in the \verb\sys\ module:
227+
\verb\sys.exc_type\ receives the object identifying the exception;
228+
\verb\sys.exc_value\ receives the exception's parameter;
229+
\verb\sys.exc_traceback\ receives a traceback object (see section
230+
\ref{traceback}) identifying the point in the program where the
231+
exception occurred.
232+
\bimodindex{sys}
233+
\ttindex{exc_type}
234+
\ttindex{exc_value}
235+
\ttindex{exc_traceback}
236+
\obindex{traceback}
237+
225238
The \verb\try...finally\ form specifies a `cleanup' handler. The
226239
\verb\try\ clause is executed. When no exception occurs, the
227240
\verb\finally\ clause is executed. When an exception occurs in the

0 commit comments

Comments
 (0)