Skip to content

Commit 71ca09b

Browse files
Allow import failure for internal _hashlib module
1 parent f6a5050 commit 71ca09b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sagemaker/workflow/utilities.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
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 as e:
30+
import typing
31+
Hash = typing.Any
2532

2633
from sagemaker.utils import base_from_name
2734
from sagemaker.workflow.parameters import Parameter

0 commit comments

Comments
 (0)