Unregister self from the default session, close the session and release the resources, ignore all exceptions in close().
(self, exc_type, exc_value, exc_tb)
| 791 | return self |
| 792 | |
| 793 | def __exit__(self, exc_type, exc_value, exc_tb): |
| 794 | """Unregister self from the default session, |
| 795 | close the session and release the resources, ignore all exceptions in close(). |
| 796 | """ |
| 797 | try: |
| 798 | self._unregister_default() |
| 799 | self.close() |
| 800 | except Exception: |
| 801 | pass |
| 802 | |
| 803 | def as_default(self): |
| 804 | """Obtain a context manager that make this object as default session. |
no test coverage detected