diff options
| -rw-r--r-- | distutils/tests/py35compat.py | 9 | ||||
| -rw-r--r-- | distutils/tests/test_filelist.py | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/distutils/tests/py35compat.py b/distutils/tests/py35compat.py index 3eb86b5f..0c755261 100644 --- a/distutils/tests/py35compat.py +++ b/distutils/tests/py35compat.py @@ -66,3 +66,12 @@ vars(subprocess).setdefault( '_optim_args_from_interpreter_flags', _optim_args_from_interpreter_flags, ) + + +def adapt_glob(regex): + """ + Supply legacy expectation on Python 3.5 + """ + if sys.version_info > (3, 6): + return regex + return regex.replace('(?s:', '').replace(r')\Z', r'\Z(?ms)') diff --git a/distutils/tests/test_filelist.py b/distutils/tests/test_filelist.py index c71342d0..71fde2b7 100644 --- a/distutils/tests/test_filelist.py +++ b/distutils/tests/test_filelist.py @@ -12,6 +12,9 @@ import test.support from test.support import captured_stdout, run_unittest from distutils.tests import support +from .py35compat import adapt_glob + + MANIFEST_IN = """\ include ok include xo @@ -60,7 +63,7 @@ class FileListTestCase(support.LoggingSilencer, ('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'), (r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z')): regex = regex % {'sep': sep} - self.assertEqual(glob_to_re(glob), regex) + self.assertEqual(glob_to_re(glob), adapt_glob(regex)) def test_process_template_line(self): # testing all MANIFEST.in template patterns |
