summaryrefslogtreecommitdiff
path: root/Lib/distutils/filelist.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-11-01 23:11:55 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-11-01 23:11:55 +0000
commit52b7ee04720d7f574182d2b89701908bc2fc8116 (patch)
tree507d2bb950b47db4ea7f715ea860fdcabcb01ae8 /Lib/distutils/filelist.py
parent7111e47901b35ffe3c3d03224e7931267ff3a92a (diff)
downloadcpython-52b7ee04720d7f574182d2b89701908bc2fc8116.tar.gz
reapplied r74493 (after #6665 fix has been backported)
Diffstat (limited to 'Lib/distutils/filelist.py')
-rw-r--r--Lib/distutils/filelist.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/distutils/filelist.py b/Lib/distutils/filelist.py
index 58a2bfb108..06a8da9a07 100644
--- a/Lib/distutils/filelist.py
+++ b/Lib/distutils/filelist.py
@@ -312,7 +312,9 @@ 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: