Skip to content

Commit

Permalink
relax exception type
Browse files Browse the repository at this point in the history
no qa
  • Loading branch information
roywei committed Aug 16, 2022
1 parent 2104fe4 commit 2d338ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sagemaker_training/smdataparallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@

# list of exceptions SMDDP wants training toolkit to catch and log
exception_classes = [x for x in dir(exceptions) if isclass(getattr(exceptions, x))]
except ImportError:
logger.info("No exception classes found in smdistributed.dataparallel")
# relaxed exception type in case of custom exceptions thrown during import
except Exception: # pylint: disable=broad-except
logger.info("smdistributed.dataparallel not found or " \
"using an older version without custom exceptions." \
"SM training toolkit will track user script error only")
exception_classes = [errors.ExecuteUserScriptError]


Expand Down

0 comments on commit 2d338ca

Please sign in to comment.