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

Skip to content

Commit 2900ff9

Browse files
committed
Added paragraph explaining that except clauses can't be empty; that
pass can be used if needed. By Dan Wolfe <[email protected]>.
1 parent 4c2533f commit 2900ff9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/tut/tut.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,6 +2751,10 @@ \section{Handling Exceptions \label{handling}}
27512751
Use this with extreme caution, since it is easy to mask a real
27522752
programming error in this way!
27532753
2754+
Each exception clause must have at least one line of executable code
2755+
in the block. Comments are not executable code. If you want the
2756+
exception clause to do nothing, use the \keyword{pass} statement.
2757+
27542758
The \keyword{try} \ldots\ \keyword{except} statement has an optional
27552759
\emph{else clause}, which must follow all except clauses. It is
27562760
useful to place code that must be executed if the try clause does not

0 commit comments

Comments
 (0)