Skip to content

Commit

Permalink
Annotate __aexit__()
Browse files Browse the repository at this point in the history
The specific annotations were copied from pool.py.
  • Loading branch information
RA80533 committed May 4, 2023
1 parent 3a637ff commit 9e671b6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions aioodbc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import warnings
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from typing import Any, Callable, Coroutine, Optional, TypeVar
from types import TracebackType
from typing import Any, Callable, Coroutine, Optional, Type, TypeVar

import pyodbc

Expand Down Expand Up @@ -260,7 +261,12 @@ def __del__(self) -> None:
async def __aenter__(self) -> Connection:
return self

async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
async def __aexit__(
self,
exc_type: Optional[Type[BaseException]],
exc: Optional[BaseException],
tb: Optional[TracebackType],
) -> None:
await self.close()
return

Expand Down

0 comments on commit 9e671b6

Please sign in to comment.