Fix Windows sock share (#2635)

This commit is contained in:
Adam Hopkins 2022-12-18 15:04:10 +02:00 committed by GitHub
parent 4744a89c33
commit 911485d52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,7 +200,7 @@ def _serve_http_1(
asyncio_server_kwargs = (
asyncio_server_kwargs if asyncio_server_kwargs else {}
)
if OS_IS_WINDOWS:
if OS_IS_WINDOWS and sock:
pid = os.getpid()
sock = sock.share(pid)
sock = socket.fromshare(sock)