-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
[C API] Add PySys_GetAttr() function #129367
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
Comments
UPDATE: I added By the way, I'm also proposing to add IMO it's still relevant to add |
See also #108512 "C API: Add a replacement for PySys_GetObject". |
Isn't it a duplicate of #108512? That issue turned out to be more complex, because we have at least 4 different functions that implements this with different particularities. |
Right. I close my issue. |
Feature or enhancement
Proposal:
The existing
PySys_GetObject()
function has two issues:I propose adding new functions
PySys_GetAttr()
andPySys_GetAttrString()
to get asys
module attribute which return a strong reference and don't ignore errors.API:
Return a new object (strong reference) on success.
Set an exception and return
NULL
on error:AttributeError
if the attribute doesn't exist.RuntimeError
if thesys
module cannot be retrieved.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: