From 78e5f10f02f1545aa337e474784879fc51a157bf Mon Sep 17 00:00:00 2001 From: DavidoTek <54072917+DavidoTek@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:41:50 +0100 Subject: [PATCH] steamutil: Do not raise an error in get_stream_vdf_compat_tool_mapping --- pupgui2/steamutil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pupgui2/steamutil.py b/pupgui2/steamutil.py index 7d1db8d1..349435e1 100644 --- a/pupgui2/steamutil.py +++ b/pupgui2/steamutil.py @@ -24,14 +24,15 @@ _cached_steam_ctool_id_map = None -def get_steam_vdf_compat_tool_mapping(vdf_file: dict): +def get_steam_vdf_compat_tool_mapping(vdf_file: dict) -> dict: s = vdf_file.get('InstallConfigStore', {}).get('Software', {}) # Sometimes the key is 'Valve', sometimes 'valve', see #226 c = s.get('Valve') or s.get('valve') if not c: - raise KeyError('Error! config.vdf InstallConfigStore.Software neither contains key "Valve" nor "valve" - config.vdf file may be invalid!') + print('Error! config.vdf InstallConfigStore.Software neither contains key "Valve" nor "valve" - config.vdf file may be invalid!') + return {} m = c.get('Steam', {}).get('CompatToolMapping', {})