diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index eaa76c26b9c591..3a7b3ad7405154 100644 --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -641,7 +641,7 @@ def eff_request_host(request): """ erhn = req_host = request_host(request) - if req_host.find(".") == -1 and not IPV4_RE.search(req_host): + if "." not in req_host: erhn = req_host + ".local" return req_host, erhn