MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _causes

Function _causes

tests/lib/tools/memory_sync/test_e2e_memory.py:33–38  ·  view source on GitHub ↗

Flatten an exception and any ExceptionGroup members it wraps.

(exc: BaseException)

Source from the content-addressed store, hash-verified

31
32
33def _causes(exc: BaseException) -> list[BaseException]:
34 """Flatten an exception and any ExceptionGroup members it wraps."""
35 inner = getattr(exc, "exceptions", None)
36 if inner is None:
37 return [exc]
38 return [exc, *(c for e in inner for c in _causes(e))]
39
40
41def fake_session(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected