summaryrefslogtreecommitdiffstats
path: root/pre_commit/file_lock.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-08-30 11:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-08-30 11:22:53 +0000
commit6cfa8e0963e9a518a25528a248932fcf41b4f969 (patch)
tree6882a2a7a3214ef85d7a946f2506e9ed2c3f60f5 /pre_commit/file_lock.py
parentAdding upstream version 2.6.0. (diff)
downloadpre-commit-6cfa8e0963e9a518a25528a248932fcf41b4f969.tar.xz
pre-commit-6cfa8e0963e9a518a25528a248932fcf41b4f969.zip
Adding upstream version 2.7.1.upstream/2.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/file_lock.py')
-rw-r--r--pre_commit/file_lock.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pre_commit/file_lock.py b/pre_commit/file_lock.py
index ff0dc5e..5e7a058 100644
--- a/pre_commit/file_lock.py
+++ b/pre_commit/file_lock.py
@@ -21,13 +21,13 @@ if os.name == 'nt': # pragma: no cover (windows)
) -> Generator[None, None, None]:
try:
# TODO: https://github.com/python/typeshed/pull/3607
- msvcrt.locking(fileno, msvcrt.LK_NBLCK, _region) # type: ignore
+ msvcrt.locking(fileno, msvcrt.LK_NBLCK, _region)
except OSError:
blocked_cb()
while True:
try:
# TODO: https://github.com/python/typeshed/pull/3607
- msvcrt.locking(fileno, msvcrt.LK_LOCK, _region) # type: ignore # noqa: E501
+ msvcrt.locking(fileno, msvcrt.LK_LOCK, _region)
except OSError as e:
# Locking violation. Returned when the _LK_LOCK or _LK_RLCK
# flag is specified and the file cannot be locked after 10
@@ -46,7 +46,7 @@ if os.name == 'nt': # pragma: no cover (windows)
# "Regions should be locked only briefly and should be unlocked
# before closing a file or exiting the program."
# TODO: https://github.com/python/typeshed/pull/3607
- msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region) # type: ignore
+ msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region)
else: # pragma: win32 no cover
import fcntl