mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 02:27:52 -06:00
fix: stop on one line when pyyaml is missing
This commit is contained in:
1 parent
eef13547e1
commit
7be8a7cd7b
7 files changed
+22
-30
No files matched your search
@@ -11,6 +11,7 @@ import pkgutil
|
||||
from abc import ABC, abstractmethod
|
||||
from pathlib import Path
|
||||
|
||||
from model.safeparse import require_yaml
|
||||
from model.sourcerevision import platform_revision
|
||||
|
||||
# Every target scraper reads the network through the platform scrapers'
|
||||
@@ -48,14 +49,10 @@ class BaseTargetScraper(ABC):
|
||||
|
||||
def write_output(self, data: dict, output_path: str) -> None:
|
||||
"""Write target data to YAML file."""
|
||||
try:
|
||||
import yaml
|
||||
except ImportError as exc:
|
||||
raise ImportError("PyYAML required: pip install pyyaml") from exc
|
||||
from core.artifacts import write_text_atomic
|
||||
|
||||
write_text_atomic(
|
||||
output_path, yaml.dump(data, default_flow_style=False, sort_keys=False)
|
||||
output_path, require_yaml().dump(data, default_flow_style=False, sort_keys=False)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user