Skip to content

Commit 9797c0d

Browse files
committed
fix: compatible on 3.9
Union instead of |
1 parent 9d5ef13 commit 9797c0d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/hytale/http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
from typing import Union
23

34
import requests
45

@@ -19,7 +20,7 @@
1920
)
2021

2122

22-
def get(path: str, sub_domain: str = "", **params) -> dict | str:
23+
def get(path: str, sub_domain: str = "", **params) -> Union[dict, str]:
2324
url = "https://" + sub_domain + BASE_URL + path
2425
try:
2526
response = _session.get(

src/hytale/models/package.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
from typing import Union
23

34
import attrs
45

@@ -21,7 +22,7 @@ class Package(FromDictMixin):
2122
id: int
2223
upgrades: dict[str, int] = {}
2324

24-
def get_color(self) -> str | None:
25+
def get_color(self) -> Union[str, None]:
2526
match = re.search(r"#([0-9A-Fa-f]{6})", self.class_)
2627
if match:
2728
return match.group(0)

0 commit comments

Comments
 (0)