MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / __del__

Method __del__

agentops/sdk/decorators/factory.py:68–74  ·  view source on GitHub ↗

Ensure span is properly ended when object is destroyed.

(self)

Source from the content-addressed store, hash-verified

66 super().__init__(*args, **kwargs)
67
68 def __del__(self):
69 """Ensure span is properly ended when object is destroyed."""
70 if hasattr(self, "_agentops_span_context_manager") and self._agentops_span_context_manager:
71 try:
72 self._agentops_span_context_manager.__exit__(None, None, None)
73 except Exception:
74 pass
75
76 async def __aenter__(self) -> "WrappedClass":
77 if hasattr(self, "_agentops_active_span") and self._agentops_active_span is not None:

Callers

nothing calls this directly

Calls 1

__exit__Method · 0.45

Tested by

no test coverage detected