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
7 changes: 5 additions & 2 deletions plugin/py_modules/game_visuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
from pathlib import Path
import re
import struct
import xml.etree.ElementTree as ET
try:
import xml.etree.ElementTree as ET
except ImportError: # Decky's frozen Python ships no ``xml`` package; SVG rails are then skipped, PNG rails still work
ET = None


def _static_svg(data):
"""Small authored rail vocabulary only: no code, raster, filters or references out."""
if len(data) > 16384 or b'<!' in data or b'<?' in data:
if ET is None or len(data) > 16384 or b'<!' in data or b'<?' in data:
return False
try:
root = ET.fromstring(data)
Expand Down