summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/filelist.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-08-17 21:28:34 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-08-17 21:28:34 (GMT)
commit98026f1521b4c549168ecb0d03f0163070f3534e (patch)
treea793fd9a2e8311c363ab94bc2eabed050e192f6a /Lib/distutils/filelist.py
parent2c9e33f3a6b97b9b3ea16a92ccf3b38d9816aa78 (diff)
downloadcpython-98026f1521b4c549168ecb0d03f0163070f3534e.zip
cpython-98026f1521b4c549168ecb0d03f0163070f3534e.tar.gz
cpython-98026f1521b4c549168ecb0d03f0163070f3534e.tar.bz2
fixed how fnmatch.translate is used (since it has changed in r74475 for #6665). Now the code is not harcoding the usage of $ anymore
Diffstat (limited to 'Lib/distutils/filelist.py')
-rw-r--r--Lib/distutils/filelist.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/distutils/filelist.py b/Lib/distutils/filelist.py
index 3ba5720..5a88fd4 100644
--- a/Lib/distutils/filelist.py
+++ b/Lib/distutils/filelist.py
@@ -342,12 +342,13 @@ def translate_pattern (pattern, anchor=1, prefix=None, is_regex=0):
pattern_re = ''
if prefix is not None:
- prefix_re = (glob_to_re(prefix))[0:-1] # ditch trailing $
+ # ditch end of pattern character
+ empty_pattern = glob_to_re('')
+ prefix_re = (glob_to_re(prefix))[:-len(empty_pattern)]
pattern_re = "^" + os.path.join(prefix_re, ".*" + pattern_re)
else: # no prefix -- respect anchor flag
if anchor:
pattern_re = "^" + pattern_re
return re.compile(pattern_re)
-
# translate_pattern ()