Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 262dc1e

Browse files
committed
Issue #27533: Release GIL in nt._isdir
2 parents 1db9222 + b22a677 commit 262dc1e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Core and Builtins
2323
Library
2424
-------
2525

26+
- Issue #27533: Release GIL in nt._isdir
27+
2628
- Issue #17711: Fixed unpickling by the persistent ID with protocol 0.
2729
Original patch by Alexandre Vassalotti.
2830

Modules/posixmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,10 +3893,12 @@ os__isdir_impl(PyObject *module, path_t *path)
38933893
{
38943894
DWORD attributes;
38953895

3896+
Py_BEGIN_ALLOW_THREADS
38963897
if (!path->narrow)
38973898
attributes = GetFileAttributesW(path->wide);
38983899
else
38993900
attributes = GetFileAttributesA(path->narrow);
3901+
Py_END_ALLOW_THREADS
39003902

39013903
if (attributes == INVALID_FILE_ATTRIBUTES)
39023904
Py_RETURN_FALSE;

0 commit comments

Comments
 (0)