Kaydet (Commit) 1ae68565 authored tarafından Georg Brandl's avatar Georg Brandl

try-except-finally is new in 2.5.

üst 304f9ff7
...@@ -3765,7 +3765,9 @@ been handled by an \keyword{except} clause (or it has occurred in a ...@@ -3765,7 +3765,9 @@ been handled by an \keyword{except} clause (or it has occurred in a
\keyword{finally} clause has been executed. The \keyword{finally} clause \keyword{finally} clause has been executed. The \keyword{finally} clause
is also executed ``on the way out'' when any other clause of the is also executed ``on the way out'' when any other clause of the
\keyword{try} statement is left via a \keyword{break}, \keyword{continue} \keyword{try} statement is left via a \keyword{break}, \keyword{continue}
or \keyword{return} statement. A more complicated example: or \keyword{return} statement. A more complicated example (having
\keyword{except} and \keyword{finally} clauses in the same \keyword{try}
statement works as of Python 2.5):
\begin{verbatim} \begin{verbatim}
>>> def divide(x, y): >>> def divide(x, y):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment