diff options
author | Max Bachmann <kontakt@maxbachmann.de> | 2025-05-07 21:45:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-07 20:45:42 +0100 |
commit | 427f8c366dcc1d9148b567c8b2cc74891abb3e98 (patch) | |
tree | ce200117101bea8c57859ddee48add4e2667128a | |
parent | 1a137bc320104bff2f392e4d8b3045c81ddb7ff2 (diff) | |
download | cpython-427f8c366dcc1d9148b567c8b2cc74891abb3e98.tar.gz cpython-427f8c366dcc1d9148b567c8b2cc74891abb3e98.zip |
gh-133517: Remove os.listdrive, os.listvolumes and os.listmounts in non-desktop Windows builds (GH-133518)
-rw-r--r-- | Misc/NEWS.d/next/Library/2025-05-06-14-44-55.gh-issue-133517.Ca6NgW.rst | 2 | ||||
-rw-r--r-- | Modules/clinic/posixmodule.c.h | 14 | ||||
-rw-r--r-- | Modules/posixmodule.c | 12 |
3 files changed, 20 insertions, 8 deletions
diff --git a/Misc/NEWS.d/next/Library/2025-05-06-14-44-55.gh-issue-133517.Ca6NgW.rst b/Misc/NEWS.d/next/Library/2025-05-06-14-44-55.gh-issue-133517.Ca6NgW.rst new file mode 100644 index 00000000000..7c53fc484a8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-05-06-14-44-55.gh-issue-133517.Ca6NgW.rst @@ -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. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 6b8cc3d07ab..3621a062541 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -1659,7 +1659,7 @@ exit: return return_value; } -#if defined(MS_WINDOWS) +#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)) PyDoc_STRVAR(os_listdrives__doc__, "listdrives($module, /)\n" @@ -1681,9 +1681,9 @@ os_listdrives(PyObject *module, PyObject *Py_UNUSED(ignored)) return os_listdrives_impl(module); } -#endif /* defined(MS_WINDOWS) */ +#endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)) */ -#if defined(MS_WINDOWS) +#if (defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)) PyDoc_STRVAR(os_listvolumes__doc__, "listvolumes($module, /)\n" @@ -1705,9 +1705,9 @@ os_listvolumes(PyObject *module, PyObject *Py_UNUSED(ignored)) return os_listvolumes_impl(module); } -#endif /* defined(MS_WINDOWS) */ +#endif /* (defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)) */ -#if defined(MS_WINDOWS) +#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)) PyDoc_STRVAR(os_listmounts__doc__, "listmounts($module, /, volume)\n" @@ -1774,7 +1774,7 @@ exit: return return_value; } -#endif /* defined(MS_WINDOWS) */ +#endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)) */ #if defined(MS_WINDOWS) @@ -13398,4 +13398,4 @@ os__emscripten_debugger(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef OS__EMSCRIPTEN_DEBUGGER_METHODDEF #define OS__EMSCRIPTEN_DEBUGGER_METHODDEF #endif /* !defined(OS__EMSCRIPTEN_DEBUGGER_METHODDEF) */ -/*[clinic end generated code: output=f7b5635e0b948be4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ae64df0389746258 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 922694fa367..2bb5f387e44 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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 @@ -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 @@ -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 @@ -4888,6 +4895,9 @@ exit: return result; } +#endif /* MS_WINDOWS_DESKTOP || MS_WINDOWS_SYSTEM */ + +#ifdef MS_WINDOWS /*[clinic input] os._path_isdevdrive |