Kaydet (Commit) ffd05ee9 authored tarafından Barry Warsaw's avatar Barry Warsaw

Added PortableUnixMailbox to the __all__ variable, and in the __main__

section use this class instead of UnixMailbox as per the comments in
the latter's class.

Bug fix candidate for 2.2.1.
üst 2eb0b87d
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
import rfc822 import rfc822
import os import os
__all__ = ["UnixMailbox","MmdfMailbox","MHMailbox","Maildir","BabylMailbox"] __all__ = ["UnixMailbox","MmdfMailbox","MHMailbox","Maildir","BabylMailbox",
"PortableUnixMailbox"]
class _Mailbox: class _Mailbox:
def __init__(self, fp, factory=rfc822.Message): def __init__(self, fp, factory=rfc822.Message):
...@@ -91,6 +92,7 @@ class _Subfile: ...@@ -91,6 +92,7 @@ class _Subfile:
del self.fp del self.fp
# Recommended to use PortableUnixMailbox instead!
class UnixMailbox(_Mailbox): class UnixMailbox(_Mailbox):
def _search_start(self): def _search_start(self):
while 1: while 1:
...@@ -282,7 +284,7 @@ def _test(): ...@@ -282,7 +284,7 @@ def _test():
mb = MHMailbox(mbox) mb = MHMailbox(mbox)
else: else:
fp = open(mbox, 'r') fp = open(mbox, 'r')
mb = UnixMailbox(fp) mb = PortableUnixMailbox(fp)
msgs = [] msgs = []
while 1: while 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment