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

Method acquire

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

Source from the content-addressed store, hash-verified

97 self.fileobj = -1
98
99 def acquire(self) -> None:
100 # create a lock file and lock it
101 self.fileobj = os.open(
102 self.filename, os.O_RDWR | os.O_CREAT | os.O_TRUNC
103 )
104 msvcrt.locking(self.fileobj, msvcrt.LK_NBLCK, 1)
105
106 self.locked = True
107
108 def release(self) -> None:
109 self.locked = False

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected