def clear_session(self): '''Clear the session to force pin (and passphrase if enabled) re-entry. Does not leak exceptions.''' logger.debug("clear session: %s", self) self.prevent_timeouts() try: ProtocolMixin.clear_session(self) except Exception as e: # If the device was removed it has the same effect... logger.error("clear_session: ignoring error %s", e)