Skip to content

Commit

Permalink
Fix clinic.
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Dec 13, 2023
1 parent a69e8cc commit 167c00d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3352,7 +3352,8 @@ os.chmod
and path should be relative; path will then be relative to that
directory.
follow_symlinks: bool(c_default="CHMOD_DEFAULT_FOLLOW_SYMLINKS") = _CHMOD_DEFAULT_FOLLOW_SYMLINKS
follow_symlinks: bool(c_default="CHMOD_DEFAULT_FOLLOW_SYMLINKS", \
py_default="(os.name != 'nt')") = True
If False, and the last element of the path is a symbolic link,
chmod will modify the symbolic link itself instead of the file
the link points to.
Expand All @@ -3369,7 +3370,7 @@ dir_fd and follow_symlinks may not be implemented on your platform.
static PyObject *
os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
int follow_symlinks)
/*[clinic end generated code: output=5cf6a94915cc7bff input=b28ffee79f567860]*/
/*[clinic end generated code: output=5cf6a94915cc7bff input=5c073e3dff76c1a4]*/
{
int result;

Expand Down Expand Up @@ -16970,7 +16971,6 @@ all_ins(PyObject *m)
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_USER_DIRS", LOAD_LIBRARY_SEARCH_USER_DIRS)) return -1;
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR", LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)) return -1;
#endif
if (PyModule_Add(m, "_CHMOD_DEFAULT_FOLLOW_SYMLINKS", PyBool_FromLong(CHMOD_DEFAULT_FOLLOW_SYMLINKS))) return -1;

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3697,7 +3697,7 @@ def converter_init(self, *, accept: TypeSet = {object}) -> None:
self.format_unit = 'i'
elif accept != {object}:
fail(f"bool_converter: illegal 'accept' argument {accept!r}")
if self.default is not unspecified:
if self.default is not unspecified and self.default is not unknown:
self.default = bool(self.default)
self.c_default = str(int(self.default))

Expand Down

0 comments on commit 167c00d

Please sign in to comment.