From 632f33ec23fa3a7aea1c98cfa53755bc2617f1da Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Fri, 4 Feb 2022 06:50:24 +0100 Subject: [PATCH] Replace `create_server` by `create_unix_server` (#1362) * Replace create_server by create_unix_server * Fix coverage --- scripts/coverage | 2 +- uvicorn/server.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/coverage b/scripts/coverage index 1dd3181d8..ec9f1b8d3 100755 --- a/scripts/coverage +++ b/scripts/coverage @@ -8,4 +8,4 @@ export SOURCE_FILES="uvicorn tests" set -x -${PREFIX}coverage report --show-missing --skip-covered --fail-under=96.96 +${PREFIX}coverage report --show-missing --skip-covered --fail-under=96.93 diff --git a/uvicorn/server.py b/uvicorn/server.py index b909b764d..328bf6882 100644 --- a/uvicorn/server.py +++ b/uvicorn/server.py @@ -134,7 +134,7 @@ def _share_socket(sock: socket.SocketType) -> socket.SocketType: uds_perms = 0o666 if os.path.exists(config.uds): uds_perms = os.stat(config.uds).st_mode - server = await loop.create_server( # type: ignore[call-overload] + server = await loop.create_unix_server( create_protocol, path=config.uds, ssl=config.ssl, backlog=config.backlog ) os.chmod(config.uds, uds_perms)