classification
Title: Make PySys_HasWarnOptions() to never raise an exception
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eric.snow, miss-islington, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2018-12-10 10:39 by serhiy.storchaka, last changed 2018-12-10 12:40 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11075 merged serhiy.storchaka, 2018-12-10 10:41
PR 11076 merged miss-islington, 2018-12-10 11:50
Messages (3)
msg331488 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-10 10:39
While "warnings" was a static variable in Python/sysmodule.c, it was guarantied that PySys_HasWarnOptions() never raises an exception. But since it became a value of the sys dict (see issue30860), it can have an arbitrary type, and PySys_HasWarnOptions() can raise an exception (while returning 0).

The proposed PR makes it never raising an exception again.
msg331502 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-10 11:50
New changeset dffccc6b594951fc798973e521da205785823f0f by Serhiy Storchaka in branch 'master':
bpo-35452: Make PySys_HasWarnOptions() never raising an exception. (GH-11075)
https://github.com/python/cpython/commit/dffccc6b594951fc798973e521da205785823f0f
msg331506 - (view) Author: miss-islington (miss-islington) Date: 2018-12-10 12:37
New changeset ea773eb1f9e79e9f558ca1fe8909cf6ac1c00371 by Miss Islington (bot) in branch '3.7':
bpo-35452: Make PySys_HasWarnOptions() never raising an exception. (GH-11075)
https://github.com/python/cpython/commit/ea773eb1f9e79e9f558ca1fe8909cf6ac1c00371
History
Date User Action Args
2018-12-10 12:40:03serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-12-10 12:37:11miss-islingtonsetnosy: + miss-islington
messages: + msg331506
2018-12-10 11:50:33miss-islingtonsetpull_requests: + pull_request10310
2018-12-10 11:50:24serhiy.storchakasetmessages: + msg331502
2018-12-10 10:47:22serhiy.storchakasettitle: Make PySys_HasWarnOptions() never raising an exception -> Make PySys_HasWarnOptions() to never raise an exception
2018-12-10 10:41:25serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request10308
2018-12-10 10:39:44serhiy.storchakacreate