]> granicus.if.org Git - python/commitdiff
Issue #27533: Release GIL in nt._isdir
authorSteve Dower <steve.dower@microsoft.com>
Mon, 18 Jul 2016 03:49:38 +0000 (20:49 -0700)
committerSteve Dower <steve.dower@microsoft.com>
Mon, 18 Jul 2016 03:49:38 +0000 (20:49 -0700)
Misc/NEWS
Modules/posixmodule.c

index 714bf6a25705f9b9b98fe80ff050a7129ff179c4..ad0eafa70d281c14205a87021220323b78361fca 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -28,6 +28,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #27533: Release GIL in nt._isdir
+
 - Issue #17711: Fixed unpickling by the persistent ID with protocol 0.
   Original patch by Alexandre Vassalotti.
 
index 3c3f80660c8adc53f99127c721fa6c6e40717cfd..ee600fc237e8c85801a5c267fb2c9a6ddb356cc6 100644 (file)
@@ -3878,10 +3878,12 @@ os__isdir_impl(PyObject *module, path_t *path)
 {
     DWORD attributes;
 
+    Py_BEGIN_ALLOW_THREADS
     if (!path->narrow)
         attributes = GetFileAttributesW(path->wide);
     else
         attributes = GetFileAttributesA(path->narrow);
+    Py_END_ALLOW_THREADS
 
     if (attributes == INVALID_FILE_ATTRIBUTES)
         Py_RETURN_FALSE;