First page Back Continue Last page Overview Graphics

Clean-up Actions

So far the try statement had always been paired with except clauses.

But there is another way to use it as well.

The try statement can be followed by a finally clause.

Finally clauses are called clean-up or termination clauses, because they must be executed under all circumstances, regardless if an exception occurred in a try block or not.