MCPcopy Create free account
hub / github.com/catboost/catboost / __init__

Method __init__

library/python/filelock/__init__.py:74–82  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

72 _LOCKED_BYTES_NUM = 1
73
74 def __init__(self, path):
75 super(_WinFileLock, self).__init__(path)
76 # nonbuffered random access rw mode
77 self._lock = os.fdopen(os.open(self.path, os.O_RDWR | os.O_CREAT | os.O_BINARY | os.O_NOINHERIT), 'r+b', 0)
78 try:
79 self._lock.write(b' ' * self._LOCKED_BYTES_NUM)
80 except IOError as e:
81 if e.errno != errno.EACCES or not os.path.isfile(path):
82 raise
83
84 def acquire(self, blocking=True):
85 locked = False

Callers

nothing calls this directly

Calls 3

__init__Method · 0.45
openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected