From: Michael R. Crusoe <crusoe@debian.org>
Subject: Fix exception checking for exit_code
Forwarded: https://github.com/DataBiosphere/toil/pull/3830

Otherwise an AttributeError is raised instead of the correct exception

--- toil.orig/src/toil/cwl/cwltoil.py
+++ toil/src/toil/cwl/cwltoil.py
@@ -3569,7 +3569,7 @@
             except Exception as err:
                 # TODO: We can't import FailedJobsException due to a circular
                 # import but that's what we'd expect here.
-                if getattr(err, "exit_code") == CWL_UNSUPPORTED_REQUIREMENT_EXIT_CODE:
+                if getattr(err, "exit_code", None) == CWL_UNSUPPORTED_REQUIREMENT_EXIT_CODE:
                     # We figured out that we can't support this workflow.
                     logging.error(err)
                     logging.error(
