refactor: keep the nt test of the partial lock

This commit is contained in:
Abdessamad Derraz committed 2026-11-17 11:10:01 +01:00
1 parent ee1755d7a4
commit a4fb158e15
1 file changed
+1 -1
+1 -1
View File
@@ -8590,7 +8590,7 @@ def _claim_partial(path: Path) -> BinaryIO | None:
flags = os.O_RDWR | os.O_CREAT | getattr(os, "O_NOFOLLOW", 0) | getattr(os, "O_BINARY", 0)
handle = os.fdopen(os.open(path, flags, 0o644), "r+b")
try:
if sys.platform == "win32":
if os.name == "nt":
import msvcrt
msvcrt.locking(handle.fileno(), msvcrt.LK_NBLCK, 1)