From ffd949f2ce3085eb0ea4c4bf45f6b2f60928e809 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 17 Jun 2019 01:21:24 -0700 Subject: [PATCH] Fix deprecated regex escape sequence. (#266) --- daphne/endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daphne/endpoints.py b/daphne/endpoints.py index 83e472a..b97364f 100644 --- a/daphne/endpoints.py +++ b/daphne/endpoints.py @@ -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.")