mirror of https://github.com/python/cpython
Maildir.__init__(): Make sure self.boxes is set.
This closes SourceForge bug #117490.
This commit is contained in:
parent
185f42d917
commit
de3518e7ca
|
@ -180,7 +180,6 @@ class Maildir:
|
||||||
# Qmail directory mailbox
|
# Qmail directory mailbox
|
||||||
|
|
||||||
def __init__(self, dirname):
|
def __init__(self, dirname):
|
||||||
import string
|
|
||||||
self.dirname = dirname
|
self.dirname = dirname
|
||||||
|
|
||||||
# check for new mail
|
# check for new mail
|
||||||
|
@ -193,6 +192,8 @@ class Maildir:
|
||||||
boxes += [os.path.join(curdir, f)
|
boxes += [os.path.join(curdir, f)
|
||||||
for f in os.listdir(curdir) if f[0] != '.']
|
for f in os.listdir(curdir) if f[0] != '.']
|
||||||
|
|
||||||
|
self.boxes = boxes
|
||||||
|
|
||||||
def next(self):
|
def next(self):
|
||||||
if not self.boxes:
|
if not self.boxes:
|
||||||
return None
|
return None
|
||||||
|
@ -225,7 +226,6 @@ class BabylMailbox(_Mailbox):
|
||||||
def _test():
|
def _test():
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
import string
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
args = sys.argv[1:]
|
args = sys.argv[1:]
|
||||||
|
@ -261,7 +261,7 @@ def _test():
|
||||||
if len(args) <= 1:
|
if len(args) <= 1:
|
||||||
msg.fp = None
|
msg.fp = None
|
||||||
if len(args) > 1:
|
if len(args) > 1:
|
||||||
num = string.atoi(args[1])
|
num = int(args[1])
|
||||||
print 'Message %d body:'%num
|
print 'Message %d body:'%num
|
||||||
msg = msgs[num-1]
|
msg = msgs[num-1]
|
||||||
msg.rewindbody()
|
msg.rewindbody()
|
||||||
|
|
Loading…
Reference in New Issue