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) diff --git a/metaflow/plugins/cards/card_cli.py b/metaflow/plugins/cards/card_cli.py index 9cb8b4bbb9d..0ddfc04bcf3 100644 --- a/metaflow/plugins/cards/card_cli.py +++ b/metaflow/plugins/cards/card_cli.py @@ -723,7 +723,7 @@ def create( mf_card, mode, task, data, timeout_value=timeout ) rendered_content = rendered_info.data - except: + except Exception: rendered_info = CardRenderInfo( mode=mode, is_implemented=True,