Catch correct exception class in params.show()

This commit is contained in:
Alexander Schepanovski
2022-05-23 00:34:34 -07:00
committed by Peter Rowlands (변기호)
parent 84439e6a04
commit b5c28dd9f9
+4 -2
View File
@@ -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: