From 00493a69543d979445236f69dc4b489e02832faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=2E=20K=C3=A4rkk=C3=A4inen?= Date: Wed, 25 Oct 2023 07:34:16 +0100 Subject: [PATCH] Format --- sanic/compat.py | 5 ++++- sanic/http/tls/context.py | 9 +++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sanic/compat.py b/sanic/compat.py index 3a9c372a..2d888fea 100644 --- a/sanic/compat.py +++ b/sanic/compat.py @@ -133,7 +133,10 @@ if use_trio: # pragma: no cover return trio.Path(path).stat() open_async = trio.open_file - CancelledErrors: tuple[type[BaseException], ...] = (asyncio.CancelledError, trio.Cancelled) + CancelledErrors: tuple[type[BaseException], ...] = ( + asyncio.CancelledError, + trio.Cancelled, + ) else: if PYPY_IMPLEMENTATION: pypy_os_module_patch() diff --git a/sanic/http/tls/context.py b/sanic/http/tls/context.py index 193ae165..9fa95b21 100644 --- a/sanic/http/tls/context.py +++ b/sanic/http/tls/context.py @@ -20,6 +20,7 @@ CIPHERS_TLS12 = [ TlsDef = None | ssl.SSLContext | dict[str, Any] | str TlsDefs = TlsDef | list[TlsDef] | tuple[TlsDef, ...] + def create_context( certfile: str | None = None, keyfile: str | None = None, @@ -38,9 +39,7 @@ def create_context( return context -def shorthand_to_ctx( - ctxdef: TlsDef -) -> ssl.SSLContext | None: +def shorthand_to_ctx(ctxdef: TlsDef) -> ssl.SSLContext | None: """Convert an ssl argument shorthand to an SSLContext object.""" if ctxdef is None or isinstance(ctxdef, ssl.SSLContext): return ctxdef @@ -54,9 +53,7 @@ def shorthand_to_ctx( ) -def process_to_context( - ssldef: TlsDefs -) -> ssl.SSLContext | None: +def process_to_context(ssldef: TlsDefs) -> ssl.SSLContext | None: """Process app.run ssl argument from easy formats to full SSLContext.""" return ( CertSelector(map(shorthand_to_ctx, ssldef))