This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients BTaskaya, Mark.Shannon, eric.smith, ethan.furman, lukasz.langa, pablogsal, ppperry, serhiy.storchaka, vstinner, xtreak
Date 2019-08-13.16:18:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565713121.26.0.516225895032.issue37830@roundup.psfhosted.org>
In-reply-to
Content
Note, that we have a regression in 3.8. There is a use case for "break" in "finally", and such code is even used in the stdlib. And who know in what third-party code it is used. In specific circumstances (see msg349513) it now can cause a crash. Other example:

import contextlib
def simple():
    with contextlib.nullcontext():
        for number in range(2):
            try:
                return number
            finally:
                break

simple()

It just raise an exception in 3.8, not crash:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 7, in simple
TypeError: 'range_iterator' object is not callable
History
Date User Action Args
2019-08-13 16:18:41serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, eric.smith, ethan.furman, lukasz.langa, Mark.Shannon, ppperry, pablogsal, xtreak, BTaskaya
2019-08-13 16:18:41serhiy.storchakasetmessageid: <1565713121.26.0.516225895032.issue37830@roundup.psfhosted.org>
2019-08-13 16:18:41serhiy.storchakalinkissue37830 messages
2019-08-13 16:18:40serhiy.storchakacreate