Skip to content

Commit

Permalink
run no_implicit_optional
Browse files Browse the repository at this point in the history
  • Loading branch information
AllSeeingEyeTolledEweSew committed Nov 11, 2022
1 parent a58b82c commit 5dd3846
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/asgi_lifespan/_concurrency/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import contextlib
import types
import typing
from typing import Optional

from .base import BaseEvent, BaseQueue, ConcurrencyBackend

Expand Down Expand Up @@ -68,8 +69,8 @@ async def run_and_silence_cancelled() -> None:
async def __aexit__(
self,
exc_type: typing.Optional[typing.Type[BaseException]] = None,
exc_value: BaseException = None,
traceback: types.TracebackType = None,
exc_value: Optional[BaseException] = None,
traceback: Optional[types.TracebackType] = None,
) -> None:
assert self.task is not None

Expand Down
5 changes: 3 additions & 2 deletions src/asgi_lifespan/_concurrency/trio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import types
import typing
from typing import Optional

import trio

Expand Down Expand Up @@ -66,7 +67,7 @@ async def __aenter__(self) -> None:
async def __aexit__(
self,
exc_type: typing.Optional[typing.Type[BaseException]] = None,
exc_value: BaseException = None,
traceback: types.TracebackType = None,
exc_value: Optional[BaseException] = None,
traceback: Optional[types.TracebackType] = None,
) -> None:
await self._exit_stack.__aexit__(exc_type, exc_value, traceback)
7 changes: 4 additions & 3 deletions src/asgi_lifespan/_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import typing
from types import TracebackType
from typing import Optional

from ._compat import AsyncExitStack
from ._concurrency import detect_concurrency_backend
Expand Down Expand Up @@ -94,9 +95,9 @@ async def __aenter__(self) -> None:

async def __aexit__(
self,
exc_type: typing.Type[BaseException] = None,
exc_value: BaseException = None,
traceback: TracebackType = None,
exc_type: Optional[typing.Type[BaseException]] = None,
exc_value: Optional[BaseException] = None,
traceback: Optional[TracebackType] = None,
) -> typing.Optional[bool]:
if exc_type is None:
self._exit_stack.push_async_callback(self.shutdown)
Expand Down

0 comments on commit 5dd3846

Please sign in to comment.