Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect line numbers at end of try-except and with statements containing if False: pass #87074

Closed
markshannon opened this issue Jan 12, 2021 · 2 comments
Assignees

Comments

@markshannon
Copy link
Member

BPO 42908
Nosy @markshannon
PRs
  • bpo-42908: Mark cleanup code at end of try-except and with artificial #24202
  • bpo-42908: Eliminate NOPs in extended blocks. #24209
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/markshannon'
    closed_at = <Date 2021-01-13.12:13:57.202>
    created_at = <Date 2021-01-12.11:25:20.605>
    labels = []
    title = 'Incorrect line numbers at end of try-except and with statements containing if False: pass'
    updated_at = <Date 2021-01-13.14:37:49.345>
    user = 'https://github.com/markshannon'

    bugs.python.org fields:

    activity = <Date 2021-01-13.14:37:49.345>
    actor = 'Mark.Shannon'
    assignee = 'Mark.Shannon'
    closed = True
    closed_date = <Date 2021-01-13.12:13:57.202>
    closer = 'Mark.Shannon'
    components = []
    creation = <Date 2021-01-12.11:25:20.605>
    creator = 'Mark.Shannon'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42908
    keywords = ['patch']
    message_count = 2.0
    messages = ['384920', '385022']
    nosy_count = 1.0
    nosy_names = ['Mark.Shannon']
    pr_nums = ['24202', '24209']
    priority = 'high'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42908'
    versions = []

    @markshannon
    Copy link
    Member Author

    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

    @markshannon
    Copy link
    Member Author

    New changeset 3bd6035 by Mark Shannon in branch 'master':
    bpo-42908: Mark cleanup code at end of try-except and with artificial (bpo-24202)
    3bd6035

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant