Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
Closed as duplicate of#108512
Description
Feature or enhancement
Proposal:
The existingPySys_GetObject()
function has two issues:
- It returns a borrowed reference.
- It ignores errors.
I propose adding new functionsPySys_GetAttr()
andPySys_GetAttrString()
to get asys
module attribute which return a strong reference and don't ignore errors.
API:
PyObject*PySys_GetAttr(PyObject*name)PyObject*PySys_GetAttrString(constchar*name)
Return a new object (strong reference) on success.
Set an exception and return
NULL
on error:- Set an
AttributeError
if the attribute doesn't exist. - Set a
RuntimeError
if thesys
module cannot be retrieved.
- Set an
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response