MCPcopy
hub / github.com/tox-dev/tox / run

Function run

src/tox/run.py:20–38  ·  view source on GitHub ↗
(args: Sequence[str] | None = None)

Source from the content-addressed store, hash-verified

18
19
20def run(args: Sequence[str] | None = None) -> None:
21 try:
22 with ToxHandler.patch_thread():
23 result = main(sys.argv[1:] if args is None else args)
24 except Exception as exception:
25 if isinstance(exception, HandledError):
26 logging.error("%s| %s", type(exception).__name__, exception) # noqa: TRY400
27 result = -2
28 else:
29 raise
30 except KeyboardInterrupt:
31 result = -2
32 finally:
33 if "_TOX_SHOW_THREAD" in os.environ: # pragma: no cover
34 import threading # pragma: no cover # noqa: PLC0415
35
36 for thread in threading.enumerate(): # pragma: no cover
37 print(thread) # pragma: no cover # noqa: T201
38 raise SystemExit(result)
39
40
41def main(args: Sequence[str]) -> int:

Calls 2

mainFunction · 0.70
patch_threadMethod · 0.45