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

Simplify except* implementation and move helpers to exceptions.c #90379

Closed
iritkatriel opened this issue Jan 1, 2022 · 2 comments
Closed

Simplify except* implementation and move helpers to exceptions.c #90379

iritkatriel opened this issue Jan 1, 2022 · 2 comments
Assignees
Labels
3.11 bug and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@iritkatriel
Copy link
Member

BPO 46221
Nosy @iritkatriel
PRs
  • bpo-46219, 46221: simplify except* implementation following exc_info changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. #30289
  • 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/iritkatriel'
    closed_at = <Date 2022-01-02.23:23:49.017>
    created_at = <Date 2022-01-01.13:59:07.040>
    labels = ['interpreter-core', '3.11']
    title = 'Simplify except* implementation and move helpers to exceptions.c'
    updated_at = <Date 2022-01-02.23:23:49.017>
    user = 'https://github.com/iritkatriel'

    bugs.python.org fields:

    activity = <Date 2022-01-02.23:23:49.017>
    actor = 'iritkatriel'
    assignee = 'iritkatriel'
    closed = True
    closed_date = <Date 2022-01-02.23:23:49.017>
    closer = 'iritkatriel'
    components = ['Interpreter Core']
    creation = <Date 2022-01-01.13:59:07.040>
    creator = 'iritkatriel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46221
    keywords = ['patch']
    message_count = 2.0
    messages = ['409458', '409541']
    nosy_count = 1.0
    nosy_names = ['iritkatriel']
    pr_nums = ['30289']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46221'
    versions = ['Python 3.11']

    @iritkatriel
    Copy link
    Member Author

    Following bpo-45711, the implementation of except* can be simplified - we do not need to use POP_EXCEPT_AND_RERAISE to reraise the exception calculated by PREP_RERAISE_STAR, we can instead

    1. Make PREP_RERAISE_STAR not push a dummy lasti to the stack.
    2. USE ROT_TWO + POP_EXCEPT + RERAISE.

    While I'm there, I will move the PREP_RERAISE_STAR helper functions (do_reraise_star etc) to exceptions.c.

    @iritkatriel iritkatriel added the 3.11 bug and security fixes label Jan 1, 2022
    @iritkatriel iritkatriel self-assigned this Jan 1, 2022
    @iritkatriel iritkatriel added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.11 bug and security fixes labels Jan 1, 2022
    @iritkatriel iritkatriel self-assigned this Jan 1, 2022
    @iritkatriel iritkatriel added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 1, 2022
    @iritkatriel
    Copy link
    Member Author

    Fixed in #30289.

    @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
    3.11 bug and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant