MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / fake_interruptible

Function fake_interruptible

src/scancode/interrupt.py:184–194  ·  view source on GitHub ↗

Fake interruptible that is not interruptible and has no timeout and is using no threads and no signals This implementation is used for debugging. This ignores the timeout and just runs the function as-is.

(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT)

Source from the content-addressed store, hash-verified

182
183
184def fake_interruptible(func, args=None, kwargs=None, timeout=DEFAULT_TIMEOUT):
185 """
186 Fake interruptible that is not interruptible and has no timeout and is using
187 no threads and no signals This implementation is used for debugging. This
188 ignores the timeout and just runs the function as-is.
189 """
190
191 try:
192 return NO_ERROR, func(*(args or ()), **(kwargs or {}))
193 except Exception:
194 return ERROR_MSG + traceback_format_exc(), NO_VALUE

Callers

nothing calls this directly

Calls 1

funcFunction · 0.50

Tested by

no test coverage detected