msg158499 - (view) |
Author: Brian Curtin (brian.curtin) *  |
Date: 2012-04-16 21:14 |
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. |
|
|
msg158515 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2012-04-17 00:30 |
Looks good on the principle. Implementation is a bit weird: you don't need to check name and path for NULL-ness? |
|
|
msg158516 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2012-04-17 00:30 |
Oh, and is PyErr_SetExcWithArgsKwargs still useful? |
|
|
msg158523 - (view) |
Author: Brian Curtin (brian.curtin) *  |
Date: 2012-04-17 02:43 |
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. |
|
|
msg158536 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2012-04-17 10:21 |
You probably want to check args and kwargs for NULL-ness too. Otherwise, looks good. |
|
|
msg158570 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-04-17 21:57 |
New changeset 7a32b9380ffd by Brian Curtin in branch 'default': Fix #14600. Correct reference handling and naming of ImportError convenience function http://hg.python.org/cpython/rev/7a32b9380ffd |
|
|
msg158669 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2012-04-18 22:05 |
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. |
|
|
msg165356 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2012-07-13 05:29 |
Eric: your note appears to be fixed in the code. Can this issue be closed? |
|
|
msg165391 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2012-07-13 16:15 |
Yep, bf23a6c215f6 fixed it, thanks for the ping. Brian or Antoine, can you close this or was there something else? |
|
|