Skip to content

Commit

Permalink
[Identity] Update async __aexit__ typing (Azure#31830)
Browse files Browse the repository at this point in the history
This ensures the signature of __aexit__ matches that the signature of
the __aexit__ in the AsyncTokenCredential protocol.

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
  • Loading branch information
pvaneck authored Aug 28, 2023
1 parent 5ca8db8 commit d8e2e9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### Other Changes

- Update typing of async credentials to match the `AsyncTokenCredential` protocol.

## 1.14.0 (2023-08-08)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Licensed under the MIT License.
# ------------------------------------
import abc
from types import TracebackType
from typing import Optional, Type

from .aad_client import AadClient
from .decorators import wrap_exceptions
Expand All @@ -16,7 +18,12 @@ async def close(self):
async def __aenter__(self):
return self

async def __aexit__(self, *args):
async def __aexit__(
self,
exc_type: Optional[Type[BaseException]] = None,
exc_value: Optional[BaseException] = None,
traceback: Optional[TracebackType] = None,
) -> None:
await self.close()


Expand Down

0 comments on commit d8e2e9f

Please sign in to comment.