MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / _catch_exception

Function _catch_exception

python/ctranslate2/extensions.py:497–503  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

495 async_results = process_func(*args, **kwargs)
496
497 def _catch_exception():
498 try:
499 for result in async_results:
500 result.result()
501 except Exception as e:
502 step_results.put(e)
503 step_results.put(None)
504
505 thread = threading.Thread(target=_catch_exception, daemon=True)
506 thread.start()

Callers

nothing calls this directly

Calls 1

putMethod · 0.80

Tested by

no test coverage detected