Flush and close the mailbox.
(self)
| 782 | return |
| 783 | |
| 784 | def close(self): |
| 785 | """Flush and close the mailbox.""" |
| 786 | try: |
| 787 | self.flush() |
| 788 | finally: |
| 789 | try: |
| 790 | if self._locked: |
| 791 | self.unlock() |
| 792 | finally: |
| 793 | self._file.close() # Sync has been done by self.flush() above. |
| 794 | |
| 795 | def _lookup(self, key=None): |
| 796 | """Return (start, stop) or raise KeyError.""" |