Issue 27911: Unnecessary error checks in exec_builtin_or_dynamic (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/72098

classification

Title: Unnecessary error checks in exec_builtin_or_dynamic
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.6, Python 3.5

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, eric.snow, ncoghlan, python-dev, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-08-31 11:22 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
exec_built_or_dynamic.patch xiang.zhang,2016-08-31 11:22 review
Messages (5)
msg274015 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-31 11:22
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.
msg274043 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-08-31 17:25
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).
msg274044 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-31 17:27
It's okay. Glad that you spare some time to reply. :)
msg274923 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-08 00:01
New changeset 96c6816825dc by Brett Cannon in branch 'default': Issue #27911: Remove some unnecessary error checks in import.c. https://hg.python.org/cpython/rev/96c6816825dc
msg274924 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-09-08 00:01
Thanks for the patch!
History
Date User Action Args
2022-04-11 14:58:35 admin set github: 72098
2016-09-08 00:01:37 brett.cannon set status: open -> closedresolution: fixedmessages: + stage: resolved
2016-09-08 00:01:12 python-dev set nosy: + python-devmessages: +
2016-08-31 17:27:57 xiang.zhang set messages: +
2016-08-31 17:25:16 brett.cannon set assignee: brett.cannonmessages: +
2016-08-31 11:22:37 xiang.zhang create