Skip to content

Commit

Permalink
Use glob.escape for paths that contain square brackets (#161)
Browse files Browse the repository at this point in the history
Co-authored-by: RJ <[email protected]>
  • Loading branch information
Liderate and Liderate authored Oct 3, 2024
1 parent a581e28 commit ae4ae8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ def createPlugins():

# We are going to list all game plugins:
curpath = os.path.abspath(os.path.dirname(__file__))
escaped_games_path = glob.escape(os.path.join(curpath, "games"))

# List all the .ini files:
for file in glob.glob(os.path.join(curpath, "games", "*.ini")):
for file in glob.glob(os.path.join(escaped_games_path, "*.ini")):
game_plugins.append(BasicIniGame(file))

# List all the python plugins:
for file in glob.glob(os.path.join(curpath, "games", "*.py")):
for file in glob.glob(os.path.join(escaped_games_path, "*.py")):
module_p = os.path.relpath(file, os.path.join(curpath, "games"))
if module_p == "__init__.py":
continue
Expand Down

0 comments on commit ae4ae8b

Please sign in to comment.