mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
GH-75586: Make shutil.which() on Windows more consistent with the OS (GH-103179)
This commit is contained in:
parent
f184abbdc9
commit
935aa45235
7 changed files with 233 additions and 54 deletions
|
@ -2054,6 +2054,26 @@ _winapi__mimetypes_read_windows_registry_impl(PyObject *module,
|
|||
#undef CB_TYPE
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
_winapi.NeedCurrentDirectoryForExePath -> bool
|
||||
|
||||
exe_name: LPCWSTR
|
||||
/
|
||||
[clinic start generated code]*/
|
||||
|
||||
static int
|
||||
_winapi_NeedCurrentDirectoryForExePath_impl(PyObject *module,
|
||||
LPCWSTR exe_name)
|
||||
/*[clinic end generated code: output=a65ec879502b58fc input=972aac88a1ec2f00]*/
|
||||
{
|
||||
BOOL result;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
result = NeedCurrentDirectoryForExePathW(exe_name);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyMethodDef winapi_functions[] = {
|
||||
_WINAPI_CLOSEHANDLE_METHODDEF
|
||||
|
@ -2089,6 +2109,7 @@ static PyMethodDef winapi_functions[] = {
|
|||
_WINAPI_GETACP_METHODDEF
|
||||
_WINAPI_GETFILETYPE_METHODDEF
|
||||
_WINAPI__MIMETYPES_READ_WINDOWS_REGISTRY_METHODDEF
|
||||
_WINAPI_NEEDCURRENTDIRECTORYFOREXEPATH_METHODDEF
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue