diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index cb3075b..d6e491c 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2270,7 +2270,9 @@ posix_listdir(PyObject *self, PyObject *args) 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) { @@ -2348,7 +2350,9 @@ posix_listdir(PyObject *self, PyObject *args) 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) |