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
Change ImportError reference handling, naming #58805
Comments
Antoine mentioned in email that the reference handling should be changed, so here's a shot at it. I also condensed and renamed the convenience functions - I was paying too much attention to the surrounding conventions and made this harder than it had to be. |
Looks good on the principle. Implementation is a bit weird: you don't need to check name and path for NULL-ness? |
Oh, and is PyErr_SetExcWithArgsKwargs still useful? |
How about this patch? Adds NULL checking and merges PyErr_SetExcWithArgsKwargs inside PyErr_SetImportError since it's not needed by itself. Docs are also updated in line with these changes. |
You probably want to check args and kwargs for NULL-ness too. Otherwise, looks good. |
New changeset 7a32b9380ffd by Brian Curtin in branch 'default': |
As was pointed on python-dev for the first commit: args = PyTuple_New(1);
if (args == NULL)
return NULL;
kwargs = PyDict_New();
if (args == NULL)
return NULL; It looks like the second block has a copy-paste typo and should check kwargs, not args. |
Eric: your note appears to be fixed in the code. |
Yep, bf23a6c215f6 fixed it, thanks for the ping. Brian or Antoine, can you close this or was there something else? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: