diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-10 00:04:13 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-10 00:04:13 (GMT) |
commit | 8cdede46128ea1b9c196c7aa6265d20e0a5f72ec (patch) | |
tree | 24080d52290a1eaef037ece134d0aa4ee632bd27 /Modules | |
parent | 9900916df4f1fa62830be24c83369de5a1f2375c (diff) | |
download | cpython-8cdede46128ea1b9c196c7aa6265d20e0a5f72ec.zip cpython-8cdede46128ea1b9c196c7aa6265d20e0a5f72ec.tar.gz cpython-8cdede46128ea1b9c196c7aa6265d20e0a5f72ec.tar.bz2 |
Merged revisions 83921 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83921 | antoine.pitrou | 2010-08-10 01:39:31 +0200 (mar., 10 août 2010) | 4 lines
Issue #6915: Under Windows, os.listdir() didn't release the Global
Interpreter Lock around all system calls. Original patch by Ryan Kelly.
........
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 d0d68c9..5237f14 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2127,7 +2127,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) { @@ -2197,7 +2199,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) |