MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / __enter__

Method __enter__

bench.py:55–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 raise BenchTimeoutError(f"Timed out after {self.seconds}s")
54
55 def __enter__(self):
56 if self._use_signal:
57 self._old = signal.signal(signal.SIGALRM, self._handler)
58 signal.alarm(self.seconds)
59 else:
60 import threading
61 self._timer = threading.Timer(self.seconds, self._timeout_thread)
62 self._timer.daemon = True
63 self._timed_out = False
64 self._timer.start()
65 return self
66
67 def __exit__(self, *exc):
68 if self._use_signal:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected