Skip to content

Commit

Permalink
Fixed DeprecationWarnings caused by invalid escape sequences (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm authored and oberstet committed Oct 8, 2018
1 parent 5be15f4 commit 87ea1cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autobahn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def wildcards2patterns(wildcards):
# match. Without this, e.g. a prefix will match:
# re.match('.*good\\.com', 'good.com.evil.com') # match!
# re.match('.*good\\.com$', 'good.com.evil.com') # no match!
return [re.compile('^' + wc.replace('.', '\.').replace('*', '.*') + '$') for wc in wildcards]
return [re.compile('^' + wc.replace('.', r'\.').replace('*', '.*') + '$') for wc in wildcards]


class ObservableMixin(object):
Expand Down
4 changes: 2 additions & 2 deletions autobahn/wamp/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self, uri, target, options=None):

if component == '':
group_count += 1
pl.append("([a-z0-9][a-z0-9_\-]*)")
pl.append(r"([a-z0-9][a-z0-9_\-]*)")
nc[group_count] = str
continue

Expand All @@ -217,7 +217,7 @@ def __init__(self, uri, target, options=None):
if nc:
# URI pattern
self._type = Pattern.URI_TYPE_WILDCARD
p = "^" + "\.".join(pl) + "$"
p = "^" + r"\.".join(pl) + "$"
self._pattern = re.compile(p)
self._names = nc
else:
Expand Down

0 comments on commit 87ea1cc

Please sign in to comment.