Skip to content

Commit ae4ae8b

Browse files
authored
Use glob.escape for paths that contain square brackets (#161)
Co-authored-by: RJ <[email protected]>
1 parent a581e28 commit ae4ae8b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ def createPlugins():
2222

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

2627
# List all the .ini files:
27-
for file in glob.glob(os.path.join(curpath, "games", "*.ini")):
28+
for file in glob.glob(os.path.join(escaped_games_path, "*.ini")):
2829
game_plugins.append(BasicIniGame(file))
2930

3031
# List all the python plugins:
31-
for file in glob.glob(os.path.join(curpath, "games", "*.py")):
32+
for file in glob.glob(os.path.join(escaped_games_path, "*.py")):
3233
module_p = os.path.relpath(file, os.path.join(curpath, "games"))
3334
if module_p == "__init__.py":
3435
continue

0 commit comments

Comments
 (0)