Skip to content

Commit 0151b2e

Browse files
committed
relax exception type
no qa
1 parent bf17a11 commit 0151b2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sagemaker_training/smdataparallel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333

3434
# list of exceptions SMDDP wants training toolkit to catch and log
3535
exception_classes = [x for x in dir(exceptions) if isclass(getattr(exceptions, x))]
36-
except ImportError:
36+
# relaxed exception type in case of custom exceptions thrown during import
37+
except Exception: # noqa W0703
3738
logger.info("No exception classes found in smdistributed.dataparallel")
3839
exception_classes = [errors.ExecuteUserScriptError]
3940

0 commit comments

Comments
 (0)