MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / set_task_debug_info

Function set_task_debug_info

mitmproxy/utils/asyncio_utils.py:38–50  ·  view source on GitHub ↗

Set debug info for an externally-spawned task.

(
    task: asyncio.Task,
    *,
    name: str,
    client: tuple | None = None,
)

Source from the content-addressed store, hash-verified

36
37
38def set_task_debug_info(
39 task: asyncio.Task,
40 *,
41 name: str,
42 client: tuple | None = None,
43) -> None:
44 """Set debug info for an externally-spawned task."""
45 task.created = time.time() # type: ignore
46 if __debug__ is True and (test := os.environ.get("PYTEST_CURRENT_TEST", None)):
47 name = f"{name} [created in {test}]"
48 task.set_name(name)
49 if client:
50 task.client = client # type: ignore
51
52
53def set_current_task_debug_info(

Callers 2

create_taskFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…