Skip to content

Commit

Permalink
Fix possibly unbound variable
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEnderek0 committed Oct 24, 2024
1 parent a5d46a1 commit 685db3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hammeraddons/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def parse(map_path: Path, game_folder: Optional[str]='') -> Config:
raise ValueError('Config "searchpaths" value cannot have children.')
assert isinstance(kv.value, str)

if kv.value.startswith("<") and (end := kv.value.find(">")): #Game mount, we just replace the <appid> with a path, this will ensure compatibility with .vpk
st = None
if (end := kv.value.find(">")) and kv.value.startswith("<"): #Game mount, we just replace the <appid> with a path, this will ensure compatibility with .vpk
st = kv.value[1:end] # Omit the first character, <
try:
st = int(st)
Expand Down

0 comments on commit 685db3b

Please sign in to comment.