mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Use re in stead of regex.
This commit is contained in:
parent
ef92edd903
commit
be614ee732
3 changed files with 34 additions and 31 deletions
|
|
@ -16,7 +16,7 @@
|
|||
#
|
||||
from MkDistr_ui import *
|
||||
import fnmatch
|
||||
import regex
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
import macfs
|
||||
|
|
@ -187,7 +187,7 @@ def rebuild1(self, (src, dst)):
|
|||
pat = fnmatch.translate(src)
|
||||
if DEBUG:
|
||||
print 'PATTERN', `src`, 'REGEX', `pat`
|
||||
self.relist.append(regex.compile(pat))
|
||||
self.relist.append(re.compile(pat))
|
||||
|
||||
def unrebuild1(self, num, src):
|
||||
del self.relist[num]
|
||||
|
|
@ -196,7 +196,7 @@ def match(self, path):
|
|||
comps = os.path.split(path)
|
||||
file = comps[-1]
|
||||
for pat in self.relist:
|
||||
if pat and pat.match(file) == len(file):
|
||||
if pat and pat.match(file):
|
||||
if DEBUG:
|
||||
print 'excmatch', file, pat
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue