summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/filelist.py
diff options
context:
space:
mode:
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 58a2bfb..06a8da9 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: