MCPcopy Index your code
hub / github.com/bpython/bpython / FileLock

Function FileLock

bpython/filelock.py:126–133  ·  view source on GitHub ↗
(
    fileobj: IO, mode: int = 0, filename: str | None = None
)

Source from the content-addressed store, hash-verified

124
125
126def FileLock(
127 fileobj: IO, mode: int = 0, filename: str | None = None
128) -> BaseLock:
129 if has_fcntl:
130 return UnixFileLock(fileobj, mode)
131 elif has_msvcrt and filename is not None:
132 return WindowsFileLock(filename)
133 return BaseLock()
134
135
136# vim: sw=4 ts=4 sts=4 ai et

Callers 3

loadMethod · 0.85
saveMethod · 0.85

Calls 3

UnixFileLockClass · 0.85
WindowsFileLockClass · 0.85
BaseLockClass · 0.85

Tested by

no test coverage detected