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: Incorrect line numbers at end of try-except and with statements containing if False: pass
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon
Priority: high Keywords: patch

Created on 2021-01-12 11:25 by Mark.Shannon, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24202 merged Mark.Shannon, 2021-01-12 15:33
PR 24209 merged Mark.Shannon, 2021-01-13 14:37
Messages (2)
msg384920 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-01-12 11:25
The following examples produce incorrect line numbers, due to cleanup code not being marked as artificial

def f():
    try:
        if False:
            pass
    except:
        X
        
def g(a):
    with a:
         if False:
             pass
msg385022 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-01-13 12:05
New changeset 3bd6035b6baf1a7d51b7cc2c6bb2c81886236b67 by Mark Shannon in branch 'master':
bpo-42908: Mark cleanup code at end of try-except and with artificial (#24202)
https://github.com/python/cpython/commit/3bd6035b6baf1a7d51b7cc2c6bb2c81886236b67
History
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87074
2021-01-13 14:37:49Mark.Shannonsetpull_requests: + pull_request23036
2021-01-13 12:13:57Mark.Shannonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-01-13 12:05:52Mark.Shannonsetmessages: + msg385022
2021-01-12 15:33:52Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request23027
2021-01-12 11:25:20Mark.Shannoncreate