MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / launch_thread

Method launch_thread

scenedetect/output/image.py:226–245  ·  view source on GitHub ↗
(callable, *args, **kwargs)

Source from the content-addressed store, hash-verified

224 return None
225
226 def launch_thread(callable, *args, **kwargs):
227 def capture_errors(callable, *args, **kwargs):
228 try:
229 return callable(*args, **kwargs)
230 # Errors we capture in `error_queue` will be re-raised by this thread.
231 except: # noqa: E722
232 error_queue.put(sys.exc_info())
233 return None
234
235 thread = threading.Thread(
236 target=capture_errors,
237 args=(
238 callable,
239 *args,
240 ),
241 kwargs=kwargs,
242 daemon=True,
243 )
244 thread.start()
245 return thread
246
247 def checked_put(work_queue: queue.Queue, item: ty.Any):
248 error = None

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected