Skip to content

Commit 07409bb

Browse files
committed
Add sshhostkeyerror
1 parent 36b534a commit 07409bb

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

dfetch/vcs/svn.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,13 @@ def list_of_branches(self) -> list[str]:
146146

147147
def list_of_tags(self) -> list[str]:
148148
"""Get list of all available tags."""
149-
output = _run_svn(["ls", f"{self._remote}/tags"], url=self._remote)
150-
return [str(tag).strip("/\r") for tag in output.split("\n") if tag]
149+
try:
150+
output = _run_svn(["ls", f"{self._remote}/tags"], url=self._remote)
151+
return [str(tag).strip("/\r") for tag in output.split("\n") if tag]
152+
except SshHostKeyError:
153+
raise
154+
except (SubprocessCommandError, RuntimeError):
155+
return []
151156

152157
@contextlib.contextmanager
153158
def browse_tree(
@@ -214,6 +219,8 @@ def is_svn(self) -> bool:
214219
with in_directory(self._path):
215220
_run_svn(["info"])
216221
return True
222+
except SshHostKeyError:
223+
raise
217224
except (SubprocessCommandError, RuntimeError):
218225
return False
219226

0 commit comments

Comments
 (0)