bpo-41985: Add _PyLong_FileDescriptor_Converter and AC converter for "fildes". (GH-22620)

This commit is contained in:
Serhiy Storchaka 2020-10-09 23:00:45 +03:00 committed by GitHub
parent b2c0a43699
commit 9975cc5008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 61 additions and 94 deletions

View file

@ -88,25 +88,6 @@ class select.kqueue "kqueue_queue_Object *" "_selectstate_global->kqueue_queue_T
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=41071028e0ede093]*/
static int
fildes_converter(PyObject *o, void *p)
{
int fd;
int *pointer = (int *)p;
fd = PyObject_AsFileDescriptor(o);
if (fd == -1)
return 0;
*pointer = fd;
return 1;
}
/*[python input]
class fildes_converter(CConverter):
type = 'int'
converter = 'fildes_converter'
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=ca54eb5aa476e20a]*/
/* list of Python objects and their file descriptor */
typedef struct {
PyObject *obj; /* owned reference */