Skip to content

Commit b22a677

Browse files
committed
Issue python#27533: Release GIL in nt._isdir
1 parent bc3e9ca commit b22a677

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Core and Builtins
2828
Library
2929
-------
3030

31+
- Issue #27533: Release GIL in nt._isdir
32+
3133
- Issue #17711: Fixed unpickling by the persistent ID with protocol 0.
3234
Original patch by Alexandre Vassalotti.
3335

Modules/posixmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,10 +3878,12 @@ os__isdir_impl(PyObject *module, path_t *path)
38783878
{
38793879
DWORD attributes;
38803880

3881+
Py_BEGIN_ALLOW_THREADS
38813882
if (!path->narrow)
38823883
attributes = GetFileAttributesW(path->wide);
38833884
else
38843885
attributes = GetFileAttributesA(path->narrow);
3886+
Py_END_ALLOW_THREADS
38853887

38863888
if (attributes == INVALID_FILE_ATTRIBUTES)
38873889
Py_RETURN_FALSE;

0 commit comments

Comments
 (0)