File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11import pathlib
22from typing import Dict , List , Text , Tuple
33
4- import pkg_resources
5-
4+ import pkgutil
65
76def axl_filename (path : pathlib .Path ) -> pathlib .Path :
87 """Given a path under Axelrod/, return absolute filepath.
@@ -24,9 +23,11 @@ def axl_filename(path: pathlib.Path) -> pathlib.Path:
2423def load_file (filename : str , directory : str ) -> List [List [str ]]:
2524 """Loads a data file stored in the Axelrod library's data subdirectory,
2625 likely for parameters for a strategy."""
27- path = "/" .join ((directory , filename ))
28- data_bytes = pkg_resources .resource_string (__name__ , path )
26+
27+ path = str (pathlib .Path (directory ) / filename )
28+ data_bytes = pkgutil .get_data (__name__ , path )
2929 data = data_bytes .decode ("UTF-8" , "replace" )
30+
3031 rows = []
3132 for line in data .split ("\n " ):
3233 if line .startswith ("#" ) or len (line ) == 0 :
You can’t perform that action at this time.
0 commit comments