diff options
author | wawaka <wawaka@yandex-team.ru> | 2022-02-10 16:47:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:48 +0300 |
commit | 76cdacbb1f8f9a6a7059a9c2ec73b06431cb6fc2 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /library/python/filelock | |
parent | ed524783c88c81047033c5d6e5543db3a2251ad5 (diff) | |
download | ydb-76cdacbb1f8f9a6a7059a9c2ec73b06431cb6fc2.tar.gz |
Restoring authorship annotation for <wawaka@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/python/filelock')
-rw-r--r-- | library/python/filelock/__init__.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/library/python/filelock/__init__.py b/library/python/filelock/__init__.py index c47fa9c28b..f81ff67f37 100644 --- a/library/python/filelock/__init__.py +++ b/library/python/filelock/__init__.py @@ -1,10 +1,10 @@ import errno import logging import os -import sys - +import sys + import library.python.windows - + logger = logging.getLogger(__name__) @@ -18,22 +18,22 @@ def set_close_on_exec(stream): class AbstractFileLock(object): - def __init__(self, path): - self.path = path - + def __init__(self, path): + self.path = path + def acquire(self, blocking=True): raise NotImplementedError - - def release(self): + + def release(self): raise NotImplementedError - - def __enter__(self): - self.acquire() - return self - - def __exit__(self, type, value, traceback): - self.release() - + + def __enter__(self): + self.acquire() + return self + + def __exit__(self, type, value, traceback): + self.release() + class _NixFileLock(AbstractFileLock): |