diff --git a/protonfixes_test.py b/protonfixes_test.py index 83ce91b9..e8d4b71a 100644 --- a/protonfixes_test.py +++ b/protonfixes_test.py @@ -192,8 +192,8 @@ def testGetGameNone(self): self.assertTrue('SteamGameId' not in os.environ, 'SteamGameId is set') self.assertTrue('UMU_ID' not in os.environ, 'UMU_ID is set') self.assertTrue('SteamAppId' not in os.environ, 'SteamAppId is set') - result = func() - self.assertFalse(result, 'None was not returned') + with self.assertRaises(SystemExit): + func() def testGetStoreNameZoom(self): """Pass zoomplatform as store name diff --git a/util.py b/util.py index ab5a0a33..8b56823b 100644 --- a/util.py +++ b/util.py @@ -85,9 +85,10 @@ def protondir() -> str: return os.path.dirname(sys.argv[0]) +@functools.lru_cache def protonprefix() -> str: - """Returns the wineprefix used by proton""" - return os.path.join(os.environ['STEAM_COMPAT_DATA_PATH'], 'pfx/') + """Returns wineprefix's path used by proton""" + return os.path.join(os.environ.get('STEAM_COMPAT_DATA_PATH', ''), 'pfx/') def protonnameversion() -> Optional[str]: