Skip to content

Commit c077d64

Browse files
xiangyan99pvaneck
andauthored
Fixed pyright error for MsalCredential (#35415)
* Fixed pyright error for `MsalCredential` * update * updates * Update sdk/identity/azure-identity/CHANGELOG.md Co-authored-by: Paul Van Eck <[email protected]> * Update sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py Co-authored-by: Paul Van Eck <[email protected]> --------- Co-authored-by: Paul Van Eck <[email protected]>
1 parent fa57b7f commit c077d64

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bugs Fixed
1010

11+
- Fixed typing errors when certain credentials are used as context managers. ([#35415](https://github.com/Azure/azure-sdk-for-python/pull/35415))
12+
1113
### Other Changes
1214

1315
## 1.16.0 (2024-04-09)

sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# ------------------------------------
55
import os
66
from typing import Any, List, Union, Dict, Optional
7+
from typing_extensions import Self
78

89
import msal
910

@@ -59,7 +60,7 @@ def __init__(
5960

6061
super(MsalCredential, self).__init__()
6162

62-
def __enter__(self) -> "MsalCredential":
63+
def __enter__(self) -> Self:
6364
self._client.__enter__()
6465
return self
6566

sdk/identity/azure-identity/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@
6363
"cryptography>=2.5",
6464
"msal>=1.24.0",
6565
"msal-extensions>=0.3.0",
66+
"typing-extensions>=4.0.0",
6667
],
6768
)

0 commit comments

Comments
 (0)