diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index c3e7f86b3e33f1..ed9fab19185bc9 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -10663,22 +10663,18 @@ PyDoc_STRVAR(os_DirEntry_is_symlink__doc__, "Return True if the entry is a symbolic link; cached per entry."); #define OS_DIRENTRY_IS_SYMLINK_METHODDEF \ - {"is_symlink", _PyCFunction_CAST(os_DirEntry_is_symlink), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_symlink__doc__}, + {"is_symlink", (PyCFunction)os_DirEntry_is_symlink, METH_NOARGS, os_DirEntry_is_symlink__doc__}, static int -os_DirEntry_is_symlink_impl(DirEntry *self, PyTypeObject *defining_class); +os_DirEntry_is_symlink_impl(DirEntry *self); static PyObject * -os_DirEntry_is_symlink(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +os_DirEntry_is_symlink(DirEntry *self, PyObject *Py_UNUSED(ignored)) { PyObject *return_value = NULL; int _return_value; - if (nargs) { - PyErr_SetString(PyExc_TypeError, "is_symlink() takes no arguments"); - goto exit; - } - _return_value = os_DirEntry_is_symlink_impl(self, defining_class); + _return_value = os_DirEntry_is_symlink_impl(self); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; } @@ -11988,4 +11984,4 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=1dd5aa7495cd6e3a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=748f5b2210b5d55e input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c4340397fbe577..e66877980c8fe4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -14550,15 +14550,13 @@ DirEntry_test_mode(PyTypeObject *defining_class, DirEntry *self, /*[clinic input] os.DirEntry.is_symlink -> bool - defining_class: defining_class - / Return True if the entry is a symbolic link; cached per entry. [clinic start generated code]*/ static int -os_DirEntry_is_symlink_impl(DirEntry *self, PyTypeObject *defining_class) -/*[clinic end generated code: output=293096d589b6d47c input=e9acc5ee4d511113]*/ +os_DirEntry_is_symlink_impl(DirEntry *self) +/*[clinic end generated code: output=42244667d7bcfc25 input=1605a1b4b96976c3]*/ { #ifdef MS_WINDOWS return (self->win32_lstat.st_mode & S_IFMT) == S_IFLNK;