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

@ -1634,18 +1634,6 @@ path_error2(path_t *path, path_t *path2)
/* POSIX generic methods */
static int
fildes_converter(PyObject *o, void *p)
{
int fd;
int *pointer = (int *)p;
fd = PyObject_AsFileDescriptor(o);
if (fd < 0)
return 0;
*pointer = fd;
return 1;
}
static PyObject *
posix_fildes_fd(int fd, int (*func)(int))
{
@ -2642,10 +2630,6 @@ class dir_fd_converter(CConverter):
else:
self.converter = 'dir_fd_converter'
class fildes_converter(CConverter):
type = 'int'
converter = 'fildes_converter'
class uid_t_converter(CConverter):
type = "uid_t"
converter = '_Py_Uid_Converter'
@ -2708,7 +2692,7 @@ class sysconf_confname_converter(path_confname_converter):
converter="conv_sysconf_confname"
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=f1c8ae8d744f6c8b]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=3338733161aa7879]*/
/*[clinic input]