feat: catch patch.object on a command

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 15:48:32 +01:00
1 parent e0f4d7eba5
commit c3054bef4c
5 files changed
+13 -7

No files matched your search

+3 -3
View File
@@ -26,7 +26,7 @@ sys.path.insert(0, os.path.dirname(__file__))
from core import upstream
from core.cli import add_repo_inputs, require_directory
from model.profiles import ProfileSelectionError, load_emulator_profiles, resolve_profile_name
from profiling.fileless import audit, unanswered_profiles
from profiling import fileless
def main() -> None:
@@ -59,12 +59,12 @@ def main() -> None:
except ProfileSelectionError as exc:
raise SystemExit(f"ERROR: {exc}") from None
if args.all:
names = unanswered_profiles(args.emulators_dir)
names = fileless.unanswered_profiles(args.emulators_dir)
flagged = unreachable = 0
for name in names:
try:
hits = audit(name, args.emulators_dir, args.cache_dir, args.offline)
hits = fileless.audit(name, args.emulators_dir, args.cache_dir, args.offline)
except upstream.UpstreamError as exc:
print(f"{name}: unreachable, {exc}", file=sys.stderr)
unreachable += 1
+2 -2
View File
@@ -34,10 +34,10 @@ from model import releaserecord
from core.cli import require_directory
from core.paths import PLATFORMS_DIR
from core.artifacts import write_text_atomic
from release import notes
from release.notes import (
changelog_url,
closing_lines,
gather_thanks,
previous_record_commit,
refused_words,
render,
@@ -79,7 +79,7 @@ def main() -> int:
thanks = [line for line in args.thanks.read_text(encoding="utf-8").splitlines()
if line.strip()]
else:
thanks = gather_thanks()
thanks = notes.gather_thanks()
except (subprocess.CalledProcessError, ValueError, KeyError, OSError) as exc:
detail = getattr(exc, "stderr", "") or exc
print(f"Error: cannot gather the thanks: {str(detail).strip()}. Pass a checked list"