diff options
Diffstat (limited to 'Lib/mailbox.py')
-rwxr-xr-x | Lib/mailbox.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py index b9f4497..fdb118d 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -107,7 +107,7 @@ class Mailbox: yield value def __iter__(self): - return self.values() + return self.itervalues() def values(self): """Return a list of messages. Memory intensive.""" @@ -456,7 +456,11 @@ class Maildir(Mailbox): """Update table of contents mapping.""" self._toc = {} for subdir in ('new', 'cur'): - for entry in os.listdir(os.path.join(self._path, subdir)): + subdir_path = os.path.join(self._path, subdir) + for entry in os.listdir(subdir_path): + p = os.path.join(subdir_path, entry) + if os.path.isdir(p): + continue uniq = entry.split(self.colon)[0] self._toc[uniq] = os.path.join(subdir, entry) |