diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-09 23:47:57 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-09 23:47:57 (GMT) |
commit | bd25d598a54dc57271e009918977815377babda0 (patch) | |
tree | 47d9cd3d2f776f0b13e287915c1ebfa697d3d255 /Modules/posixmodule.c | |
parent | 87d5260362faf07c5332679aa27e35aef5dd3a34 (diff) | |
download | cpython-bd25d598a54dc57271e009918977815377babda0.zip cpython-bd25d598a54dc57271e009918977815377babda0.tar.gz cpython-bd25d598a54dc57271e009918977815377babda0.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/posixmodule.c')
-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) |