Index: Modules/posixmodule.c =================================================================== --- Modules/posixmodule.c (revision 74797) +++ Modules/posixmodule.c (working copy) @@ -928,7 +928,9 @@ { HANDLE hFindFile; WIN32_FIND_DATAA FileData; + Py_BEGIN_ALLOW_THREADS hFindFile = FindFirstFileA(pszFile, &FileData); + Py_END_ALLOW_THREADS if (hFindFile == INVALID_HANDLE_VALUE) return FALSE; FindClose(hFindFile); @@ -946,7 +948,9 @@ { HANDLE hFindFile; WIN32_FIND_DATAW FileData; + Py_BEGIN_ALLOW_THREADS hFindFile = FindFirstFileW(pszFile, &FileData); + Py_END_ALLOW_THREADS if (hFindFile == INVALID_HANDLE_VALUE) return FALSE; FindClose(hFindFile); @@ -2107,7 +2111,9 @@ free(wnamebuf); return NULL; } + Py_BEGIN_ALLOW_THREADS hFindFile = FindFirstFileW(wnamebuf, &wFileData); + Py_END_ALLOW_THREADS if (hFindFile == INVALID_HANDLE_VALUE) { int error = GetLastError(); if (error == ERROR_FILE_NOT_FOUND) { @@ -2177,7 +2183,9 @@ if ((d = PyList_New(0)) == NULL) return NULL; + Py_BEGIN_ALLOW_THREADS hFindFile = FindFirstFile(namebuf, &FileData); + Py_END_ALLOW_THREADS if (hFindFile == INVALID_HANDLE_VALUE) { int error = GetLastError(); if (error == ERROR_FILE_NOT_FOUND)