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/utils/text.py | |
parent | 17677d510f65012531a5af57fd056fb15cfe1067 (diff) | |
download | django-8119b679eb85cdc0ae3d321e54d06dd0200a1e82.tar.gz |
Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.
http://bugs.python.org/issue27364
Diffstat (limited to 'django/utils/text.py')
-rw-r--r-- | django/utils/text.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/utils/text.py b/django/utils/text.py index 3b8fc581bf..a77f27eed7 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -423,11 +423,11 @@ def slugify(value, allow_unicode=False): value = force_text(value) if allow_unicode: value = unicodedata.normalize('NFKC', value) - value = re.sub('[^\w\s-]', '', value, flags=re.U).strip().lower() - return mark_safe(re.sub('[-\s]+', '-', value, flags=re.U)) + value = re.sub(r'[^\w\s-]', '', value, flags=re.U).strip().lower() + return mark_safe(re.sub(r'[-\s]+', '-', value, flags=re.U)) value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii') - value = re.sub('[^\w\s-]', '', value).strip().lower() - return mark_safe(re.sub('[-\s]+', '-', value)) + value = re.sub(r'[^\w\s-]', '', value).strip().lower() + return mark_safe(re.sub(r'[-\s]+', '-', value)) def camel_case_to_spaces(value): |