summaryrefslogtreecommitdiffstats
path: root/Lib/mailbox.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-01-19 20:12:04 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2008-01-19 20:12:04 (GMT)
commit15ce880cc8c3de29e91e2e867b2db0b19a48e5f3 (patch)
treee1ad90f90c0a1d6d69b207423eabdfc7d25fde75 /Lib/mailbox.py
parentc6fde7293e57f16affb068f60b1998114e041b91 (diff)
downloadcpython-15ce880cc8c3de29e91e2e867b2db0b19a48e5f3.zip
cpython-15ce880cc8c3de29e91e2e867b2db0b19a48e5f3.tar.gz
cpython-15ce880cc8c3de29e91e2e867b2db0b19a48e5f3.tar.bz2
Bug 1277: make Maildir use the user-provided factory instead of hard-wiring MaildirMessage.
2.5.2 bugfix candidate.
Diffstat (limited to 'Lib/mailbox.py')
-rwxr-xr-xLib/mailbox.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 3f7a12a..e3e9cbb 100755
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -315,7 +315,10 @@ class Maildir(Mailbox):
subpath = self._lookup(key)
f = open(os.path.join(self._path, subpath), 'r')
try:
- msg = MaildirMessage(f)
+ if self._factory:
+ msg = self._factory(f)
+ else:
+ msg = MaildirMessage(f)
finally:
f.close()
subdir, name = os.path.split(subpath)