Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts`
in non Windows desktop builds since the underlying functionality is missing.
14 changes: 7 additions & 7 deletions Modules/clinic/posixmodule.c.h

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

12 changes: 11 additions & 1 deletion Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -4698,7 +4698,7 @@ os_listdir_impl(PyObject *module, path_t *path)
}


#ifdef MS_WINDOWS
#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)

/*[clinic input]
os.listdrives
Expand Down Expand Up @@ -4747,6 +4747,10 @@ os_listdrives_impl(PyObject *module)
return result;
}

#endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */

#if defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)

/*[clinic input]
os.listvolumes

Expand Down Expand Up @@ -4808,6 +4812,9 @@ os_listvolumes_impl(PyObject *module)
return result;
}

#endif /* MS_WINDOWS_APP || MS_WINDOWS_SYSTEM */

#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)

/*[clinic input]
os.listmounts
Expand Down Expand Up @@ -4888,6 +4895,9 @@ os_listmounts_impl(PyObject *module, path_t *volume)
return result;
}

#endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */

#ifdef MS_WINDOWS

/*[clinic input]
os._path_isdevdrive
Expand Down
Loading