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

Unnecessary error checks in exec_builtin_or_dynamic #72098

Closed
zhangyangyu opened this issue Aug 31, 2016 · 5 comments
Closed

Unnecessary error checks in exec_builtin_or_dynamic #72098

zhangyangyu opened this issue Aug 31, 2016 · 5 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@zhangyangyu
Copy link
Member

BPO 27911
Nosy @brettcannon, @ncoghlan, @ericsnowcurrently, @zhangyangyu
Files
  • exec_built_or_dynamic.patch
  • 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/brettcannon'
    closed_at = <Date 2016-09-08.00:01:37.376>
    created_at = <Date 2016-08-31.11:22:37.852>
    labels = ['interpreter-core', 'type-feature']
    title = 'Unnecessary error checks in exec_builtin_or_dynamic'
    updated_at = <Date 2016-09-08.00:01:37.374>
    user = 'https://github.com/zhangyangyu'

    bugs.python.org fields:

    activity = <Date 2016-09-08.00:01:37.374>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2016-09-08.00:01:37.376>
    closer = 'brett.cannon'
    components = ['Interpreter Core']
    creation = <Date 2016-08-31.11:22:37.852>
    creator = 'xiang.zhang'
    dependencies = []
    files = ['44294']
    hgrepos = []
    issue_num = 27911
    keywords = ['patch']
    message_count = 5.0
    messages = ['274015', '274043', '274044', '274923', '274924']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'ncoghlan', 'python-dev', 'eric.snow', 'xiang.zhang']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue27911'
    versions = ['Python 3.5', 'Python 3.6']

    @zhangyangyu
    Copy link
    Member Author

    The two PyErr_Occurred check in exec_builtin_or_dynamic are unnecessary. The PyModule_Check at the beginning of exec_builtin_or_dynamic has eliminated the possibility for PyModule_GetDef/State to fail.

    @zhangyangyu zhangyangyu added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Aug 31, 2016
    @brettcannon
    Copy link
    Member

    Patch LGTM. Thanks for catching that, Xiang! I'll commit your fix when I can (might not be until after 3.6b1 since feature improvements are taking priority on my time to make the feature freeze deadline).

    @brettcannon brettcannon self-assigned this Aug 31, 2016
    @zhangyangyu
    Copy link
    Member Author

    It's okay. Glad that you spare some time to reply. :)

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 8, 2016

    New changeset 96c6816825dc by Brett Cannon in branch 'default':
    Issue bpo-27911: Remove some unnecessary error checks in import.c.
    https://hg.python.org/cpython/rev/96c6816825dc

    @brettcannon
    Copy link
    Member

    Thanks for the patch!

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants