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

Function interrupt

tests/native/conftest.py:23–31  ·  view source on GitHub ↗
(
        frame: FrameType, event: str, operation: BuiltinFunctionType | None
    )

Source from the content-addressed store, hash-verified

21 lock: UnixFileLock, error: type[BaseException] = KeyboardInterrupt
22) -> None: # pragma: needs fcntl
23 def interrupt(
24 frame: FrameType, event: str, operation: BuiltinFunctionType | None
25 ) -> None: # pragma: no cover # profile hooks run with tracing disabled
26 if (
27 event == "c_return"
28 and frame.f_code.co_name == "open_into"
29 and (operation is os.open or getattr(operation, "__name__", None) == "extend")
30 ):
31 raise error
32
33 previous = sys.getprofile()
34 sys.setprofile(interrupt)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected