diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-11-01 23:11:55 +0000 |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-11-01 23:11:55 +0000 |
commit | 52b7ee04720d7f574182d2b89701908bc2fc8116 (patch) | |
tree | 507d2bb950b47db4ea7f715ea860fdcabcb01ae8 /Lib/distutils/filelist.py | |
parent | 7111e47901b35ffe3c3d03224e7931267ff3a92a (diff) | |
download | cpython-52b7ee04720d7f574182d2b89701908bc2fc8116.tar.gz |
reapplied r74493 (after #6665 fix has been backported)
Diffstat (limited to 'Lib/distutils/filelist.py')
-rw-r--r-- | Lib/distutils/filelist.py | 4 |
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: |