From b5c28dd9f9f125bdbde03c46865fcccbb1ad1c85 Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Mon, 16 May 2022 19:23:16 +0500 Subject: [PATCH] Catch correct exception class in params.show() --- dvc/repo/params/show.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dvc/repo/params/show.py b/dvc/repo/params/show.py index 677e33a68..2b55ec0d5 100644 --- a/dvc/repo/params/show.py +++ b/dvc/repo/params/show.py @@ -4,6 +4,8 @@ from collections import defaultdict from copy import copy from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple +from scmrepo.exceptions import SCMError + from dvc.dependency.param import ParamsDependency from dvc.repo import locked from dvc.repo.collect import collect @@ -117,8 +119,8 @@ def show(repo, revs=None, targets=None, deps=False, onerror: Callable = None): # Hide workspace params if they are the same as in the active branch try: active_branch = repo.scm.active_branch() - except (TypeError, NoSCMError): - # TypeError - detached head + except (SCMError, NoSCMError): + # SCMError - detached head # NoSCMError - no repo case pass else: