branch : pmacs2
This commit is contained in:
moculus 2008-11-11 16:29:04 +00:00
parent 0684488a25
commit d6e51fa204
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import commands, dirutil, grp, mailbox, method, mode, os.path, pwd, re
import commands, dirutil, grp, mailbox, method, mode, os.path, pwd, re, sys
import buffer, default, window
from mode.mutt import MuttGrammar
from lex import Grammar, PatternRule, RegionRule, PatternGroupRule
@ -134,7 +134,11 @@ class MboxListBuffer(Buffer):
f = open(self.path, 'r')
self.size = len(f.read())
f.close()
self.mbox = mailbox.mbox(self.path)
if sys.version_info == 4:
fp = open(self.path, 'rb')
self.mbox = mailbox.UnixMailbox(fp)
else:
self.mbox = mailbox.mbox(self.path)
lines = []
pos = 1
msgs = list(self.mbox)