Prophylactic code- don't fails too hard if Steam .VDFs are corrupt

We should be able to use WINE without Proton even if Steam is b0rked.

This commit will cause Lutris to see no Proton locations at all if the Steam
config is unreadable.
This commit is contained in:
Daniel Johnson 2022-11-26 18:13:38 -05:00
parent b8620311d7
commit 04c342b42a

View file

@ -36,10 +36,15 @@ def get_playonlinux():
def _iter_proton_locations():
"""Iterate through all existing Proton locations"""
for path in [os.path.join(p, "common") for p in steam().get_steamapps_dirs()]:
try:
steamapp_dirs = steam().get_steamapps_dirs()
except:
return # in case of corrupt or unreadable Steam configuration files!
for path in [os.path.join(p, "common") for p in steamapp_dirs]:
if os.path.isdir(path):
yield path
for path in [os.path.join(p, "") for p in steam().get_steamapps_dirs()]:
for path in [os.path.join(p, "") for p in steamapp_dirs]:
if os.path.isdir(path):
yield path