mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Convert all remaining *simple* cases of regex usage to re usage.
This commit is contained in:
parent
426916e50e
commit
9694fcab53
23 changed files with 134 additions and 144 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue