Fix deprecated regex escape sequence. (#266)

This commit is contained in:
Simon Willison 2019-06-17 01:21:24 -07:00 committed by Carlton Gibson
parent f46c2448b1
commit ffd949f2ce

View File

@ -8,7 +8,7 @@ def build_endpoint_description_strings(
"""
socket_descriptions = []
if host and port is not None:
host = host.strip("[]").replace(":", "\:")
host = host.strip("[]").replace(":", r"\:")
socket_descriptions.append("tcp:port=%d:interface=%s" % (int(port), host))
elif any([host, port]):
raise ValueError("TCP binding requires both port and host kwargs.")