File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import sys
12from importlib .resources import as_file , files
23
34import pandas as pd
@@ -17,6 +18,10 @@ def load(slug: str) -> gbt.Game:
1718 """
1819 Load a game from the package catalog.
1920 """
21+ # Handle backslashes for Windows
22+ if sys .platform == "win32" :
23+ game_slug .replace ("/" , "\\ " ) # noqa: F821
24+
2025 for suffix , reader in READERS .items ():
2126 resource_path = _CATALOG_RESOURCE / f"{ slug } { suffix } "
2227
@@ -45,6 +50,10 @@ def games() -> pd.DataFrame:
4550 rel_path = resource_path .relative_to (_CATALOG_RESOURCE )
4651 game_slug = str (rel_path .with_suffix ("" ))
4752
53+ # Replace backslashes for Windows
54+ if sys .platform == "win32" :
55+ game_slug .replace ("\\ " , "/" ) # noqa: F821
56+
4857 with as_file (resource_path ) as path :
4958 game = reader (str (path ))
5059 records .append (
You can’t perform that action at this time.
0 commit comments