Flush and close the mailbox.
(self)
| 789 | return |
| 790 | |
| 791 | def close(self): |
| 792 | """Flush and close the mailbox.""" |
| 793 | try: |
| 794 | self.flush() |
| 795 | finally: |
| 796 | try: |
| 797 | if self._locked: |
| 798 | self.unlock() |
| 799 | finally: |
| 800 | self._file.close() # Sync has been done by self.flush() above. |
| 801 | |
| 802 | def _lookup(self, key=None): |
| 803 | """Return (start, stop) or raise KeyError.""" |