mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix warnings originating from bad regexes
Starting with python 3.6 warnings are issued for invalid escape sequences in regular expressions. This commit corrects all DeprecationWarning's via properly declaring the offending regular expressions as raw strings. Resolves #2095.
This commit is contained in:
parent
fb07f4d513
commit
89b28fd36b
6 changed files with 11 additions and 11 deletions
|
|
@ -305,8 +305,8 @@ def slugify(value, substitutions=()):
|
|||
replace = replace and not skip
|
||||
|
||||
if replace:
|
||||
value = re.sub('[^\w\s-]', '', value).strip()
|
||||
value = re.sub('[-\s]+', '-', value)
|
||||
value = re.sub(r'[^\w\s-]', '', value).strip()
|
||||
value = re.sub(r'[-\s]+', '-', value)
|
||||
else:
|
||||
value = value.strip()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue