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.

classification
Title: break/continue or return in finally block occurs twice in trace.
Type: behavior Stage: resolved
Components: Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, nedbat
Priority: normal Keywords: patch

Created on 2020-12-15 12:21 by Mark.Shannon, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23780 merged Mark.Shannon, 2020-12-15 15:42
Messages (2)
msg383044 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2020-12-15 12:21
This function

def f():
     try:
         return 2
     finally:
         4

would generate a try of [1, 2, 4, 2].  It should generate [1, 2, 4]
and not trace the return twice.
msg383165 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2020-12-16 13:07
New changeset 5274b682bc93a04da8a69742528ac7f64633a96e by Mark Shannon in branch 'master':
bpo-42645: Make sure that return/break/continue are only traced once when exiting via a finally block. (GH-23780)
https://github.com/python/cpython/commit/5274b682bc93a04da8a69742528ac7f64633a96e
History
Date User Action Args
2022-04-11 14:59:39adminsetgithub: 86811
2020-12-17 13:56:51Mark.Shannonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-12-16 13:07:11Mark.Shannonsetmessages: + msg383165
2020-12-15 15:42:24Mark.Shannonsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request22638
2020-12-15 12:21:32Mark.Shannoncreate