Skip to content

Commit f12d9f0

Browse files
committed
Use typing.Dict for dict hints
Hopefully fixes a TypeError on python>3.9
1 parent 41c641c commit f12d9f0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

xbox/webapi/api/provider/ratelimitedprovider.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
Subclassed by providers with rate limit support
55
"""
66

7-
from typing import Union
7+
from typing import Union, Dict
88
from xbox.webapi.api.provider.baseprovider import BaseProvider
99
from xbox.webapi.common.ratelimits.models import LimitType, ParsedRateLimit, TimePeriod
1010
from xbox.webapi.common.ratelimits import CombinedRateLimit
1111

1212

1313
class RateLimitedProvider(BaseProvider):
14-
RATE_LIMITS: dict[str, Union[int, dict[str, int]]]
14+
# dict -> Dict (typing.dict) https://stackoverflow.com/a/63460173
15+
RATE_LIMITS: Dict[str, Union[int, Dict[str, int]]]
1516

1617
def __init__(self, client):
1718
"""
@@ -41,7 +42,7 @@ def __init__(self, client):
4142
)
4243

4344
def __parse_rate_limit_key(
44-
self, key: Union[int, dict[str, int]], period: TimePeriod
45+
self, key: Union[int, Dict[str, int]], period: TimePeriod
4546
) -> ParsedRateLimit:
4647
key_type = type(key)
4748
if key_type == int:

0 commit comments

Comments
 (0)