mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-31672: Restore the former behavior when override flags in Template. (#5099)
Overriding flags to 0 will make the default pattern matching only lower case letters.
This commit is contained in:
parent
78e24d4415
commit
87be28f4a1
3 changed files with 21 additions and 11 deletions
|
|
@ -82,11 +82,8 @@ class Template(metaclass=_TemplateMetaclass):
|
|||
# r'[a-z]' matches to non-ASCII letters when used with IGNORECASE, but
|
||||
# without the ASCII flag. We can't add re.ASCII to flags because of
|
||||
# backward compatibility. So we use the ?a local flag and [a-z] pattern.
|
||||
# We also can't remove the A-Z ranges, because although they are
|
||||
# technically redundant with the IGNORECASE flag, the value is part of the
|
||||
# publicly documented API.
|
||||
# See https://bugs.python.org/issue31672
|
||||
idpattern = r'(?a:[_a-zA-Z][_a-zA-Z0-9]*)'
|
||||
idpattern = r'(?a:[_a-z][_a-z0-9]*)'
|
||||
braceidpattern = None
|
||||
flags = _re.IGNORECASE
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue