Skip to content

Commit 6df830a

Browse files
committed
Guard NODEV on Python 3.15
1 parent ba00d28 commit 6df830a

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

stdlib/os/__init__.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,10 @@ if sys.platform != "win32" and sys.version_info >= (3, 13):
447447
__all__ += ["grantpt", "posix_openpt", "ptsname", "unlockpt"]
448448
if sys.platform != "win32" and sys.version_info >= (3, 11):
449449
__all__ += ["login_tty"]
450-
if sys.platform != "win32":
450+
if sys.platform != "win32" and sys.version_info >= (3, 15):
451451
__all__ += ["NODEV", "O_FSYNC"]
452+
elif sys.platform != "win32":
453+
__all__ += ["O_FSYNC"]
452454
if sys.platform != "darwin" and sys.platform != "win32":
453455
__all__ += [
454456
"POSIX_FADV_DONTNEED",
@@ -667,8 +669,10 @@ if sys.platform == "darwin":
667669
O_NOFOLLOW_ANY: Final[int]
668670
O_SYMLINK: Final[int]
669671

670-
if sys.platform != "win32":
672+
if sys.platform != "win32" and sys.version_info >= (3, 15):
671673
NODEV: Final[int]
674+
675+
if sys.platform != "win32":
672676
O_FSYNC: Final[int]
673677

674678
if sys.platform != "linux" and sys.platform != "win32" and sys.version_info >= (3, 13):

stdlib/posix.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ if sys.platform != "win32":
263263
if sys.platform != "linux" and sys.version_info >= (3, 13):
264264
from os import O_EXEC as O_EXEC, O_SEARCH as O_SEARCH
265265

266-
from os import NODEV as NODEV
266+
if sys.version_info >= (3, 15):
267+
from os import NODEV as NODEV
267268

268269
if sys.platform != "darwin":
269270
from os import (

0 commit comments

Comments
 (0)