Skip to content

Commit

Permalink
Merge pull request #987 from touma-I/quick-patch-fcntl
Browse files Browse the repository at this point in the history
aded quick patch disabling fcntl for Windows
  • Loading branch information
touma-I authored Jan 28, 2025
2 parents 5f86475 + 874ad6e commit 5523100
Show file tree
Hide file tree
Showing 3 changed files with 8,663 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

import abc
import datetime
import fcntl
import platform
if platform.system() != 'Windows':
import fcntl
import os
import tempfile
import threading
Expand Down Expand Up @@ -98,7 +100,8 @@ def acquire(self, block=True, timeout=None):
timeout = max(0, timeout)
while not locked and (timeout is None or waited <= timeout):
try:
fcntl.lockf(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
if platform.system() != 'Windows':
fcntl.lockf(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
locked = True
except Exception as exc:
# Only get here if lock could not be acquired
Expand Down
Loading

0 comments on commit 5523100

Please sign in to comment.