Permalink
Browse files

Refs #27025, #28593 -- Fixed "invalid escape sequence" warnings in ur…

…ls/resolvers.py.
  • Loading branch information...
jdufresne authored and timgraham committed Oct 1, 2017
1 parent 41406bf commit f0ffa3f4ea277f9814285085fde20baff60fc386
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/urls/resolvers.py
View
@@ -119,7 +119,7 @@ def _check_pattern_startswith_slash(self):
# Skip check as it can be useful to start a URL pattern with a slash
# when APPEND_SLASH=False.
return []
- if regex_pattern.startswith(('/', '^/', '^\/')) and not regex_pattern.endswith('/'):
+ if regex_pattern.startswith(('/', '^/', '^\\/')) and not regex_pattern.endswith('/'):
warning = Warning(
"Your URL pattern {} has a route beginning with a '/'. Remove this "
"slash as it is unnecessary. If this pattern is targeted in an "
@@ -187,7 +187,7 @@ def __str__(self):
_PATH_PARAMETER_COMPONENT_RE = re.compile(
- '<(?:(?P<converter>[^>:]+):)?(?P<parameter>\w+)>'
+ r'<(?:(?P<converter>[^>:]+):)?(?P<parameter>\w+)>'
)

0 comments on commit f0ffa3f

Please sign in to comment.