diff --git a/metaflow/cli_components/run_cmds.py b/metaflow/cli_components/run_cmds.py index 82272b70568..64d7a2fa347 100644 --- a/metaflow/cli_components/run_cmds.py +++ b/metaflow/cli_components/run_cmds.py @@ -278,7 +278,7 @@ def resume( # be non-integers to avoid any clashes. This condition ensures this. try: int(run_id) - except: + except (TypeError, ValueError): pass else: raise CommandException("run-id %s cannot be an integer" % run_id) diff --git a/metaflow/cli_components/step_cmd.py b/metaflow/cli_components/step_cmd.py index 24ca9d784a0..6f7d719cf01 100644 --- a/metaflow/cli_components/step_cmd.py +++ b/metaflow/cli_components/step_cmd.py @@ -127,7 +127,7 @@ def step( func = None try: func = getattr(ctx.obj.flow, step_name) - except: + except AttributeError: raise CommandException("Step *%s* doesn't exist." % step_name) if not func.is_step: raise CommandException("Function *%s* is not a step." % step_name)