Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/qemu/ot/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from collections.abc import Callable
from io import BytesIO
from os.path import abspath, dirname, exists, isdir, isfile, join as joinpath
from subprocess import check_output
from subprocess import SubprocessError, check_output
from sys import stdout
from textwrap import dedent, indent
from typing import Any, Iterable, Optional, TextIO, Union
Expand Down Expand Up @@ -265,7 +265,7 @@ def retrieve_git_version(path: str, max_tag_dist: int = 100) \
if distance <= max_tag_dist:
return descstr
return '-'.join(filter(None, (gmo.group('commit'), dirty)))
except (OSError, ValueError):
except (OSError, SubprocessError, ValueError):
pass
try:
change = check_output(['git', 'status', '--porcelain'],
Expand All @@ -275,7 +275,7 @@ def retrieve_git_version(path: str, max_tag_dist: int = 100) \
if len(change) > 1:
descstr = f'{descstr}-dirty'
return descstr
except OSError:
except (OSError, SubprocessError):
pass
return None

Expand Down
Loading