Skip to content

Commit 5198f28

Browse files
fix: Allow import failure for internal _hashlib module (#5192)
* fix: Allow import failure for _hashlib module * Fix formatting * Appease flake8
1 parent aba802c commit 5198f28

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/sagemaker/workflow/utilities.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@
2121
import hashlib
2222
from urllib.parse import unquote, urlparse
2323
from contextlib import contextmanager
24-
from _hashlib import HASH as Hash
24+
25+
try:
26+
# _hashlib is an internal python module, and is not present in
27+
# statically linked interpreters.
28+
from _hashlib import HASH as Hash
29+
except ImportError:
30+
import typing
31+
32+
Hash = typing.Any
2533

2634
from sagemaker.utils import base_from_name
2735
from sagemaker.workflow.parameters import Parameter

0 commit comments

Comments
 (0)