diff options
| author | Tim Graham <timograham@gmail.com> | 2016-09-16 12:15:00 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-17 15:44:06 -0400 |
| commit | 8119b679eb85cdc0ae3d321e54d06dd0200a1e82 (patch) | |
| tree | b4f4e40a371569a260a39ca310e8e984d8582d74 /django/template | |
| parent | 17677d510f65012531a5af57fd056fb15cfe1067 (diff) | |
Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.
http://bugs.python.org/issue27364
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/base.py | 2 | ||||
| -rw-r--r-- | django/template/defaultfilters.py | 2 | ||||
| -rw-r--r-- | django/template/defaulttags.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/django/template/base.py b/django/template/base.py index 778d82be55..13037c31aa 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -639,7 +639,7 @@ filter_raw_string = r""" )""" % { 'constant': constant_string, 'num': r'[-+\.]?\d[\d\.e]*', - 'var_chars': "\w\.", + 'var_chars': r'\w\.', 'filter_sep': re.escape(FILTER_SEPARATOR), 'arg_sep': re.escape(FILTER_ARGUMENT_SEPARATOR), } diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index e3dc48e474..b258cf269b 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -259,7 +259,7 @@ def stringformat(value, arg): def title(value): """Converts a string into titlecase.""" t = re.sub("([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title()) - return re.sub("\d([A-Z])", lambda m: m.group(0).lower(), t) + return re.sub(r"\d([A-Z])", lambda m: m.group(0).lower(), t) @register.filter(is_safe=True) diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index ece6f7501d..71fcbbaab3 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -1329,7 +1329,7 @@ def templatetag(parser, token): @register.tag def url(parser, token): - """ + r""" Return an absolute URL matching the given view with its parameters. This is a way to define links that aren't tied to a particular URL |
