diff --git a/qiskit_ibm_runtime/api/session.py b/qiskit_ibm_runtime/api/session.py index 20f390ba7..2423704e1 100644 --- a/qiskit_ibm_runtime/api/session.py +++ b/qiskit_ibm_runtime/api/session.py @@ -170,7 +170,11 @@ def __init__( def __del__(self) -> None: """RetrySession destructor. Closes the session.""" - self.close() + try: + self.close() + except Exception: # pylint: disable=broad-except + # ignore errors that may happen during cleanup + pass def _initialize_retry( self, retries_total: int, retries_connect: int, backoff_factor: float