Skip to content

Commit 9de14dd

Browse files
committed
Update os.path.isdir on Windows Python3.12+
1 parent 96eaa76 commit 9de14dd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stdlib/ntpath.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import sys
2-
from _typeshed import BytesPath, StrPath
2+
from _typeshed import BytesPath, FileDescriptorOrPath, StrPath
33
from genericpath import (
44
commonprefix as commonprefix,
55
exists as exists,
66
getatime as getatime,
77
getctime as getctime,
88
getmtime as getmtime,
99
getsize as getsize,
10-
isdir as isdir,
1110
isfile as isfile,
1211
samefile as samefile,
1312
sameopenfile as sameopenfile,
@@ -115,5 +114,10 @@ if sys.platform == "win32":
115114
@overload
116115
def realpath(path: AnyStr) -> AnyStr: ...
117116

117+
if sys.version_info >= (3, 12):
118+
def isdir(path: FileDescriptorOrPath) -> bool: ...
119+
else:
120+
def isdir(s: FileDescriptorOrPath) -> bool: ...
121+
118122
else:
119123
realpath = abspath

tests/stubtest_allowlists/win32-py312.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ asyncio.IocpProactor.recvfrom_into
44
asyncio.windows_events.IocpProactor.finish_socket_func
55
asyncio.windows_events.IocpProactor.recvfrom_into
66
msvcrt.GetErrorMode
7-
ntpath.isdir
8-
os.path.isdir

0 commit comments

Comments
 (0)