Skip to content

Commit

Permalink
Fix invalid escape sequence warning.
Browse files Browse the repository at this point in the history
Python 3.7 warns about unrecognized escape sequences in strings.

Remove the backslash escapes for the `/` character. This doesn't
need to be escaped for re match patterns; it only has special
meaning in sed-style substitution patterns.

Another possible fix is to use raw strings, r"^(https?:)?\/\/"
which leave the backslash characters to the re package to
interpret. It doesn't mind the sequences, but they're still
unnecessary.
  • Loading branch information
rillian authored and PonteIneptique committed Jul 5, 2019
1 parent b0b81ce commit e2d475c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flask_nemo/query/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def read(self, uri):
class HTTPRetriever(RetrieverPrototype):
""" Http retriever retrieves resources being remotely hosted in CTS
"""
__reg_exp__ = re.compile("^(https?:)?\/\/")
__reg_exp__ = re.compile("^(https?:)?//")

def match(self, uri):
""" Check to see if this URI is retrievable by this Retriever implementation
Expand Down

0 comments on commit e2d475c

Please sign in to comment.