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.
........
This commit is contained in:
Antoine Pitrou 2010-08-10 00:04:13 +00:00
parent 9900916df4
commit 8cdede4612
3 changed files with 8 additions and 0 deletions

View file

@ -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)