MCPcopy Create free account
hub / github.com/tox-dev/filelock / pid

Method pid

src/filelock/_soft.py:144–155  ·  view source on GitHub ↗

The PID of the process holding this lock, read from the lock file. :returns: the PID as an integer, or ``None`` if the lock file does not exist or cannot be parsed

(self)

Source from the content-addressed store, hash-verified

142
143 @property
144 def pid(self) -> int | None:
145 """
146 The PID of the process holding this lock, read from the lock file.
147
148 :returns: the PID as an integer, or ``None`` if the lock file does not exist or cannot be parsed
149
150 """
151 with suppress(OSError, ValueError):
152 holder = _parse_lock_holder(_read_lock_file(self.lock_file)[0])
153 if holder is not None:
154 return holder[0]
155 return None
156
157 @property
158 def is_lock_held_by_us(self) -> bool:

Callers

nothing calls this directly

Calls 2

_parse_lock_holderFunction · 0.85
_read_lock_fileFunction · 0.85

Tested by

no test coverage detected