fix flaky test involving web_server.py in windows

This commit is contained in:
Arvid Norberg
2026-04-28 12:26:20 +02:00
committed by Arvid Norberg
parent 125be04f17
commit 92504c4e4d
+5 -2
View File
@@ -171,8 +171,6 @@ class http_handler(BaseHTTPRequestHandler):
self.send_header('Content-Encoding', 'gzip')
if not keepalive:
self.send_header("Connection", "close")
if not use_ssl:
self.request.shutdown(socket.SHUT_RD)
self.end_headers()
@@ -203,6 +201,11 @@ class http_handler(BaseHTTPRequestHandler):
self.end_headers()
except Exception:
pass
if not keepalive and not use_ssl:
try:
self.request.shutdown(socket.SHUT_RD)
except Exception:
pass
print("...DONE")
sys.stdout.flush()