Closes this session. This method frees all resources associated with the session. Note that closing will ignore SIGINT and SIGTERM signal and recover later.
(self)
| 697 | return not self._disconnected |
| 698 | |
| 699 | def close(self): |
| 700 | """Closes this session. |
| 701 | |
| 702 | This method frees all resources associated with the session. |
| 703 | |
| 704 | Note that closing will ignore SIGINT and SIGTERM signal and recover later. |
| 705 | """ |
| 706 | if threading.current_thread() is threading.main_thread(): |
| 707 | with SignalIgnore([signal.SIGINT, signal.SIGTERM]): |
| 708 | self._close() |
| 709 | else: |
| 710 | self._close() |
| 711 | |
| 712 | def _close(self): # noqa: C901 |
| 713 | if self._closed: |
no test coverage detected