Skip to content

Commit f7f79fe

Browse files
aminalaeecsm10495
authored andcommitted
pythongh-109782: Ensure os.path.isdir has the same signature on all platforms (pythonGH-109790)
1 parent 9b3e4ab commit f7f79fe

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Ensure the signature of :func:`os.path.isdir` is identical on all platforms.
2+
Patch by Amin Alaee.

Modules/clinic/posixmodule.c.h

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/posixmodule.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -4912,25 +4912,25 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
49124912
/*[clinic input]
49134913
os._path_isdir
49144914
4915-
path: 'O'
4915+
s: 'O'
49164916
49174917
Return true if the pathname refers to an existing directory.
49184918
49194919
[clinic start generated code]*/
49204920

49214921
static PyObject *
4922-
os__path_isdir_impl(PyObject *module, PyObject *path)
4923-
/*[clinic end generated code: output=00faea0af309669d input=b1d2571cf7291aaf]*/
4922+
os__path_isdir_impl(PyObject *module, PyObject *s)
4923+
/*[clinic end generated code: output=9d87ab3c8b8a4e61 input=c17f7ef21d22d64e]*/
49244924
{
49254925
HANDLE hfile;
49264926
BOOL close_file = TRUE;
49274927
FILE_BASIC_INFO info;
4928-
path_t _path = PATH_T_INITIALIZE("isdir", "path", 0, 1);
4928+
path_t _path = PATH_T_INITIALIZE("isdir", "s", 0, 1);
49294929
int result;
49304930
BOOL slow_path = TRUE;
49314931
FILE_STAT_BASIC_INFORMATION statInfo;
49324932

4933-
if (!path_converter(path, &_path)) {
4933+
if (!path_converter(s, &_path)) {
49344934
path_cleanup(&_path);
49354935
if (PyErr_ExceptionMatches(PyExc_ValueError)) {
49364936
PyErr_Clear();

0 commit comments

Comments
 (0)