Flush and close the mailbox.
(self)
| 726 | return |
| 727 | |
| 728 | def close(self): |
| 729 | """Flush and close the mailbox.""" |
| 730 | try: |
| 731 | self.flush() |
| 732 | finally: |
| 733 | try: |
| 734 | if self._locked: |
| 735 | self.unlock() |
| 736 | finally: |
| 737 | self._file.close() # Sync has been done by self.flush() above. |
| 738 | |
| 739 | def _lookup(self, key=None): |
| 740 | """Return (start, stop) or raise KeyError.""" |