mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 09:23:26 -05:00
fix: refuse an unparseable platform original
This commit is contained in:
1 parent
be0443a935
commit
213d19ed27
3 files changed
+36
-4
No files matched your search
@@ -131,8 +131,13 @@ class Exporter(BaseExporter):
|
||||
if original:
|
||||
try:
|
||||
root = parse_untrusted_xml(original, self.native_filename(), comments=True)
|
||||
except (ParseError, ValueError):
|
||||
root = None
|
||||
except (ParseError, ValueError) as exc:
|
||||
# Rebuilt from our model alone, the export would drop every
|
||||
# system we do not transcribe and the maintainer's comments.
|
||||
raise ValueError(
|
||||
f"Recalbox's {self.native_filename()} does not parse ({exc}); "
|
||||
"fetch it again with --refresh-cache"
|
||||
) from exc
|
||||
if root is not None:
|
||||
theirs = [
|
||||
(s.get("platform", ""), s.get("fullname", ""), [
|
||||
|
||||
@@ -69,8 +69,11 @@ class Exporter(BaseExporter):
|
||||
if original:
|
||||
try:
|
||||
base = json.loads(original, object_pairs_hook=OrderedDict)
|
||||
except json.JSONDecodeError:
|
||||
base = {}
|
||||
except json.JSONDecodeError as exc:
|
||||
raise ValueError(
|
||||
f"RetroBat's {self.native_filename()} does not parse ({exc}); "
|
||||
"fetch it again with --refresh-cache"
|
||||
) from exc
|
||||
|
||||
exportable = {
|
||||
system.native_id: (system, files)
|
||||
|
||||
Reference in new issue
Block a user