summaryrefslogtreecommitdiffstats
path: root/Lib/mailbox.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-10-22 21:00:49 (GMT)
committerGuido van Rossum <guido@python.org>1997-10-22 21:00:49 (GMT)
commit9694fcab5332f27dc28b195ba1391e5491d2eaef (patch)
tree23dc3d9a7d1cc4b138ac2bffd028a519cba93b30 /Lib/mailbox.py
parent426916e50e1209d8ecc12678855dc531863a48c5 (diff)
downloadcpython-9694fcab5332f27dc28b195ba1391e5491d2eaef.zip
cpython-9694fcab5332f27dc28b195ba1391e5491d2eaef.tar.gz
cpython-9694fcab5332f27dc28b195ba1391e5491d2eaef.tar.bz2
Convert all remaining *simple* cases of regex usage to re usage.
Diffstat (limited to 'Lib/mailbox.py')
-rwxr-xr-xLib/mailbox.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 4c4eebe..37a4636 100755
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -5,7 +5,6 @@
import rfc822
import os
-import regex
class _Mailbox:
def __init__(self, fp):
@@ -117,12 +116,13 @@ class MmdfMailbox(_Mailbox):
class MHMailbox:
def __init__(self, dirname):
- pat = regex.compile('^[0-9][0-9]*$')
+ import re
+ pat = re.compile('^[0-9][0-9]*$')
self.dirname = dirname
files = os.listdir(self.dirname)
self.boxes = []
for f in files:
- if pat.match(f) == len(f):
+ if pat.match(f):
self.boxes.append(f)
def next(self):
@@ -187,6 +187,7 @@ def _test():
if not msg:
break
msgs.append(msg)
+ msg.fp = None
if len(args) > 1:
num = string.atoi(args[1])
print 'Message %d body:'%num