Message127545
| Author |
belopolsky |
| Recipients |
Arach, Arfrever, belopolsky, daniel.urban, marcin.bachry, theller |
| Date |
2011年01月30日.16:46:00 |
| SpamBayes Score |
2.722973e-06 |
| Marked as misclassified |
No |
| Message-id |
<1296405962.69.0.840459622834.issue11048@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It would be nice to add a unit test to this patch. I don't think messing with read-only filesystems is feasible in regrtest, but it seems from reading _ctypes_alloc_callback() source that similar behavior can be triggered by passing a failing converters list to a ctypes function constructor.
A nit-pick: it would be easier to verify that all CThunkObject fields are initialized if initialization was done in the same order as declaration:
typedef struct {
PyObject_VAR_HEAD
...
PyObject *callable;
PyObject *restype;
SETFUNC setfunc;
ffi_type *ffi_restype;
ffi_type *atypes[1];
} CThunkObject;
In other words, "p->restype = NULL;" should go after "p->callable = NULL;". |
|