MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / __exit__

Method __exit__

python/openshell/sandbox.py:713–734  ·  view source on GitHub ↗
(self, *args: object)

Source from the content-addressed store, hash-verified

711 return self
712
713 def __exit__(self, *args: object) -> None:
714 try:
715 if (
716 self._delete_on_exit
717 and self._session is not None
718 and self._client is not None
719 ):
720 try:
721 deleted = self._session.delete()
722 if deleted:
723 self._client.wait_deleted(self._session.sandbox.name)
724 except grpc.RpcError as exc:
725 if (
726 not isinstance(exc, grpc.Call)
727 or exc.code() != grpc.StatusCode.NOT_FOUND
728 ):
729 raise
730 finally:
731 if self._client is not None:
732 self._client.close()
733 self._session = None
734 self._client = None
735
736 def exec(
737 self,

Callers

nothing calls this directly

Calls 4

wait_deletedMethod · 0.80
codeMethod · 0.80
deleteMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected