summaryrefslogtreecommitdiff
path: root/distutils2
diff options
context:
space:
mode:
author?ric Araujo <merwok@netwok.org>2011-11-20 19:02:08 +0100
committer?ric Araujo <merwok@netwok.org>2011-11-20 19:02:08 +0100
commit3fd9d8cc01d307513abf74c17f8f6573dacb8b36 (patch)
treeb8e3e290c11ad00c363b5db520660cfa989780fa /distutils2
parent47c9f06f2d34971a1c554c0020dc603c3ce3aaa1 (diff)
downloaddisutils2-3fd9d8cc01d307513abf74c17f8f6573dacb8b36.tar.gz
Make test_manifest pass on 2.4 and 2.5 (fixes #11751).
The code added massages the output of fnmatch in old Pythons to make it match more recent behavior (it was changed in 2.6 to append '\Z(?ms)' instead of '$', to support newline characters in filenames). I could have changed the tests, but I prefer having the code do the same thing for all versions as far as possible.
Diffstat (limited to 'distutils2')
-rw-r--r--distutils2/manifest.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/distutils2/manifest.py b/distutils2/manifest.py
index 5960c2f..12d627b 100644
--- a/distutils2/manifest.py
+++ b/distutils2/manifest.py
@@ -346,6 +346,10 @@ def _glob_to_re(pattern):
# Unix-only.
pattern_re = re.sub(r'((?<!\\)(\\\\)*)\.', r'\1[^/]', pattern_re)
+ if pattern_re.endswith('$'):
+ # make it look like fnmatch in Python 2.6 and newer
+ pattern_re = pattern_re[:-1] + r'\Z(?ms)'
+
return pattern_re