Skip to content

Commit 2235c0b

Browse files
committed
Make sbom.py compatible with 3.10
1 parent 1dc08cc commit 2235c0b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sbom.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@
2626
import zipfile
2727
from functools import cache
2828
from pathlib import Path
29-
from typing import Any, LiteralString, NotRequired, TypedDict, cast
29+
from typing import Any, TypedDict, cast
3030
from urllib.request import urlopen
3131

32+
try:
33+
from typing import LiteralString
34+
except ImportError:
35+
LiteralString = str
36+
37+
try:
38+
from typing import NotRequired
39+
except ImportError:
40+
NotRequired = typing.Optional
3241

3342
class SBOM(TypedDict):
3443
SPDXID: str

0 commit comments

Comments
 (0)