Skip to content

Commit

Permalink
Merge branch 'release/2.10.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Jul 13, 2024
2 parents 06d58c4 + c2c433d commit 4d5905f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion portalocker/__about__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__package_name__ = 'portalocker'
__author__ = 'Rick van Hattem'
__email__ = '[email protected]'
__version__ = '2.10.0'
__version__ = '2.10.1'
__description__ = '''Wraps the portalocker recipe for easy usage'''
__url__ = 'https://github.com/WoLpH/portalocker'
2 changes: 1 addition & 1 deletion portalocker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#: Current author's email address
__email__ = __about__.__email__
#: Version number
__version__ = '2.10.0'
__version__ = '2.10.1'
#: Package description for Pypi
__description__ = __about__.__description__
#: Package homepage
Expand Down
4 changes: 2 additions & 2 deletions portalocker/portalocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def unlock(file_: typing.IO):
LOCKER = fcntl.flock

def lock(file_: typing.Union[typing.IO, int], flags: LockFlags):
assert LOCKER is not None, 'We need a locing function in `LOCKER` '
assert LOCKER is not None, 'We need a locking function in `LOCKER` '
# Locking with NON_BLOCKING without EXCLUSIVE or SHARED enabled
# results in an error
if (flags & LockFlags.NON_BLOCKING) and not flags & (
Expand Down Expand Up @@ -147,7 +147,7 @@ def lock(file_: typing.Union[typing.IO, int], flags: LockFlags):
) from exc_value

def unlock(file_: typing.IO):
assert LOCKER is not None, 'We need a locing function in `LOCKER` '
assert LOCKER is not None, 'We need a locking function in `LOCKER` '
LOCKER(file_.fileno(), LockFlags.UNBLOCK)

else: # pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions portalocker_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ def test_exclusive_processes(tmpfile: str, fail_when_locked: bool, locker):
result_b = pool.apply_async(lock, [tmpfile, fail_when_locked, flags])

try:
a = result_a.get(timeout=1.0) # Wait for 'a' with timeout
a = result_a.get(timeout=1.1) # Wait for 'a' with timeout
except multiprocessing.TimeoutError:
a = None

try:
# Lower timeout since we already waited with `a`
b = result_b.get(timeout=0.1) # Wait for 'b' with timeout
b = result_b.get(timeout=0.2) # Wait for 'b' with timeout
except multiprocessing.TimeoutError:
b = None

Expand Down

0 comments on commit 4d5905f

Please sign in to comment.