Skip to content

Commit 1ca2a2f

Browse files
aminalaeeAlexWaygood
authored andcommitted
pythongh-109782: Ensure os.path.isdir has the same signature on all platforms (pythonGH-109790)
1 parent 8296b53 commit 1ca2a2f

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
@@ -4901,25 +4901,25 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
49014901
/*[clinic input]
49024902
os._path_isdir
49034903
4904-
path: 'O'
4904+
s: 'O'
49054905
49064906
Return true if the pathname refers to an existing directory.
49074907
49084908
[clinic start generated code]*/
49094909

49104910
static PyObject *
4911-
os__path_isdir_impl(PyObject *module, PyObject *path)
4912-
/*[clinic end generated code: output=00faea0af309669d input=b1d2571cf7291aaf]*/
4911+
os__path_isdir_impl(PyObject *module, PyObject *s)
4912+
/*[clinic end generated code: output=9d87ab3c8b8a4e61 input=c17f7ef21d22d64e]*/
49134913
{
49144914
HANDLE hfile;
49154915
BOOL close_file = TRUE;
49164916
FILE_BASIC_INFO info;
4917-
path_t _path = PATH_T_INITIALIZE("isdir", "path", 0, 1);
4917+
path_t _path = PATH_T_INITIALIZE("isdir", "s", 0, 1);
49184918
int result;
49194919
BOOL slow_path = TRUE;
49204920
FILE_STAT_BASIC_INFORMATION statInfo;
49214921

4922-
if (!path_converter(path, &_path)) {
4922+
if (!path_converter(s, &_path)) {
49234923
path_cleanup(&_path);
49244924
if (PyErr_ExceptionMatches(PyExc_ValueError)) {
49254925
PyErr_Clear();

0 commit comments

Comments
 (0)