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

#1760: try-except-finally is one statement since PEP 341.

üst 1b4758d2
...@@ -203,10 +203,10 @@ the code block where the error occurred. ...@@ -203,10 +203,10 @@ the code block where the error occurred.
The Python interpreter raises an exception when it detects a run-time error The Python interpreter raises an exception when it detects a run-time error
(such as division by zero). A Python program can also explicitly raise an (such as division by zero). A Python program can also explicitly raise an
exception with the :keyword:`raise` statement. Exception handlers are specified exception with the :keyword:`raise` statement. Exception handlers are specified
with the :keyword:`try` ... :keyword:`except` statement. The :keyword:`try` ... with the :keyword:`try` ... :keyword:`except` statement. The :keyword:`finally`
:keyword:`finally` statement specifies cleanup code which does not handle the clause of such a statement can be used to specify cleanup code which does not
exception, but is executed whether an exception occurred or not in the preceding handle the exception, but is executed whether an exception occurred or not in
code. the preceding code.
.. index:: single: termination model .. index:: single: termination model
......
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