Skip to content

Commit 431c268

Browse files
Fix type hints for Python 3.9.
1 parent e30a48c commit 431c268

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cwmscli/commands/blob.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import os
66
import re
77
import sys
8-
from typing import Optional, Sequence
8+
from typing import Optional, Sequence, Union
99

1010
import cwms
1111
import pandas as pd
1212
import requests
1313

14-
from cwmscli.utils import get_api_key
14+
from cwmscli.utils import get_api_key, has_invalid_chars
1515
from cwmscli.utils.deps import requires
1616

1717
# used to rebuild data URL for images
@@ -27,7 +27,7 @@
2727
"link": "https://docs.python.org/3/library/imghdr.html",
2828
}
2929
)
30-
def _determine_ext(data: bytes | str, write_type: str) -> str:
30+
def _determine_ext(data: Union[bytes, str], write_type: str) -> str:
3131
"""
3232
Attempt to determine the file extension from the data itself.
3333
Requires the imghdr module (lazy import) to inspect the bytes for image types.
@@ -51,7 +51,7 @@ def _determine_ext(data: bytes | str, write_type: str) -> str:
5151
def _save_base64(
5252
b64_or_dataurl: str,
5353
dest: str,
54-
media_type_hint: str | None = None,
54+
media_type_hint: Optional[str] = None,
5555
) -> str:
5656
m = DATA_URL_RE.match(b64_or_dataurl.strip())
5757
if m:

0 commit comments

Comments
 (0)