Issue #28070: Fixed parsing inline verbose flag in regular expressions.

This commit is contained in:
Serhiy Storchaka 2016-09-11 01:39:01 +03:00
parent 99a6570295
commit d65cd091e9
3 changed files with 6 additions and 0 deletions

View File

@ -847,6 +847,7 @@ def parse(str, flags=0, pattern=None):
pattern = Pattern()
pattern.flags = flags | SRE_FLAG_VERBOSE
pattern.str = str
source.seek(0)
p = _parse_sub(source, pattern, True, False)
p.pattern.flags = fix_flags(str, p.pattern.flags)

View File

@ -1276,6 +1276,9 @@ class ReTests(unittest.TestCase):
q = p.match(upper_char)
self.assertTrue(q)
self.assertTrue(re.match('(?ixu) ' + upper_char, lower_char))
self.assertTrue(re.match('(?ixu) ' + lower_char, upper_char))
def test_dollar_matches_twice(self):
"$ matches the end of string, and just before the terminating \n"
pattern = re.compile('$')

View File

@ -138,6 +138,8 @@ Core and Builtins
Library
-------
- Issue #28070: Fixed parsing inline verbose flag in regular expressions.
- Issue #19500: Add client-side SSL session resumption to the ssl module.
- Issue #28022: Deprecate ssl-related arguments in favor of SSLContext. The