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 2016-09-08 00:01 by brett.cannon. 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
2016-09-08 00:01:37brett.cannonsetstatus: open -> closed
resolution: fixed
messages: + msg274924

stage: resolved
2016-09-08 00:01:12python-devsetnosy: + python-dev
messages: + msg274923
2016-08-31 17:27:57xiang.zhangsetmessages: + msg274044
2016-08-31 17:25:16brett.cannonsetassignee: brett.cannon
messages: + msg274043
2016-08-31 11:22:37xiang.zhangcreate