MCPcopy Create free account
hub / github.com/bpython/bpython / acquire

Method acquire

bpython/filelock.py:70–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 self.mode = mode | fcntl.LOCK_EX
69
70 def acquire(self) -> None:
71 try:
72 fcntl.flock(self.fileobj, self.mode)
73 self.locked = True
74 except OSError as e:
75 if e.errno != errno.ENOLCK:
76 raise e
77
78 def release(self) -> None:
79 self.locked = False

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected