@@ -321,8 +321,8 @@ not handled, the exception is temporarily saved. The :keyword:`finally` clause
321321is executed. If there is a saved exception it is re-raised at the end of the
322322:keyword: `finally ` clause. If the :keyword: `finally ` clause raises another
323323exception, the saved exception is set as the context of the new exception.
324- If the :keyword: `finally ` clause executes a :keyword: `return ` or :keyword: `break `
325- statement, the saved exception is discarded::
324+ If the :keyword: `finally ` clause executes a :keyword: `return `, :keyword: `break `
325+ or :keyword: ` continue ` statement, the saved exception is discarded::
326326
327327 >>> def f():
328328 ... try:
@@ -343,10 +343,7 @@ the :keyword:`finally` clause.
343343
344344When a :keyword: `return `, :keyword: `break ` or :keyword: `continue ` statement is
345345executed in the :keyword: `try ` suite of a :keyword: `try `...\ :keyword: `finally `
346- statement, the :keyword: `finally ` clause is also executed 'on the way out.' A
347- :keyword: `continue ` statement is illegal in the :keyword: `finally ` clause. (The
348- reason is a problem with the current implementation --- this restriction may be
349- lifted in the future).
346+ statement, the :keyword: `finally ` clause is also executed 'on the way out.'
350347
351348The return value of a function is determined by the last :keyword: `return `
352349statement executed. Since the :keyword: `finally ` clause always executes, a
@@ -366,6 +363,10 @@ Additional information on exceptions can be found in section :ref:`exceptions`,
366363and information on using the :keyword: `raise ` statement to generate exceptions
367364may be found in section :ref: `raise `.
368365
366+ .. versionchanged :: 3.8
367+ Prior to Python 3.8, a :keyword: `continue ` statement was illegal in the
368+ :keyword: `finally ` clause due to a problem with the implementation.
369+
369370
370371.. _with :
371372.. _as :
0 commit comments