Skip to content

Commit

Permalink
steamutil: Do not raise an error in get_stream_vdf_compat_tool_mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidoTek committed Jan 6, 2025
1 parent bb3ba5a commit 78e5f10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pupgui2/steamutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', {})

Expand Down

0 comments on commit 78e5f10

Please sign in to comment.