Skip to content

Commit

Permalink
Catch regex exception and print debug information
Browse files Browse the repository at this point in the history
Refs #47
  • Loading branch information
Matoking committed Feb 2, 2020
1 parent fc59bdf commit 27f4742
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/protontricks/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import logging
import os
import re
import sre_constants
import string
import struct
import sys
import zlib
from pathlib import Path

Expand Down Expand Up @@ -757,14 +759,21 @@ def get_steam_apps(steam_root, steam_path, steam_lib_paths):

for path in steam_lib_paths:
appmanifest_paths = []
if os.path.isdir(os.path.join(path, "steamapps")):
appmanifest_paths = glob.glob(
os.path.join(path, "steamapps", "appmanifest_*.acf")
)
elif os.path.isdir(os.path.join(path, "SteamApps")):
appmanifest_paths = glob.glob(
os.path.join(path, "SteamApps", "appmanifest_*.acf")
)
try:
if os.path.isdir(os.path.join(path, "steamapps")):
appmanifest_paths = glob.glob(
os.path.join(path, "steamapps", "appmanifest_*.acf")
)
elif os.path.isdir(os.path.join(path, "SteamApps")):
appmanifest_paths = glob.glob(
os.path.join(path, "SteamApps", "appmanifest_*.acf")
)
except sre_constants.error as exc:
print("catched error ")
print(str(exc))
print(path)
print(os.path.join(path, "steamapps", "appmanifest_*.acf"))
sys.exit(0)

for manifest_path in appmanifest_paths:
steam_app = SteamApp.from_appmanifest(
Expand Down

0 comments on commit 27f4742

Please sign in to comment.