Fix python 3.6 escape char warning

In python 3.6, escape sequences that are not
recognized in string literals issue DeprecationWarnings.

Convert these to raw strings.

Change-Id: I508a9147b932e219069eeee756bcbc43c7e961c5
This commit is contained in:
Eric Harney 2017-07-31 11:57:44 -04:00
parent 6fe3018de8
commit 1868200e9c
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ def strip_version(endpoint):
(scheme, netloc, path, __, __, __) = url_parts
path = path.lstrip('/')
# regex to match 'v1' or 'v2.0' etc
if re.match('v\d+\.?\d*', path):
if re.match(r'v\d+\.?\d*', path):
version = float(path.lstrip('v'))
endpoint = scheme + '://' + netloc
return endpoint, version