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

Function runner

src/scancode/interrupt.py:127–136  ·  view source on GitHub ↗

Run the func and send results back in a queue as a tuple of (`error`, `value`)

()

Source from the content-addressed store, hash-verified

125 results = Queue()
126
127 def runner():
128 """
129 Run the func and send results back in a queue as a tuple of
130 (`error`, `value`)
131 """
132 try:
133 _res = func(*(args or ()), **(kwargs or {}))
134 results.put((NO_ERROR, _res,))
135 except Exception:
136 results.put((ERROR_MSG + traceback_format_exc(), NO_VALUE,))
137
138 tid = start_new_thread(runner, ())
139

Callers

nothing calls this directly

Calls 2

putMethod · 0.65
funcFunction · 0.50

Tested by

no test coverage detected