Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.

http://bugs.python.org/issue27364
This commit is contained in:
Tim Graham 2016-09-16 12:15:00 -04:00
parent 17677d510f
commit 8119b679eb
42 changed files with 82 additions and 82 deletions

View file

@ -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):