diff --git a/map2map/main.py b/map2map/main.py index 7b65930..a31643c 100644 --- a/map2map/main.py +++ b/map2map/main.py @@ -14,9 +14,9 @@ from functools import partial def _load_resource_file(resource_path): # Import the package - pkg_files = importlib.resources.files() - with pkg_files.open(resource_path) as file: - return file.read_text() # Read the file and return its content + pkg_files = importlib.resources.files() / resource_path + with pkg_files.open() as file: + return file.read() # Read the file and return its content def _str_list(value): return value.split(',') @@ -86,8 +86,7 @@ def _apply_options(options_file, f): return f -def m2m_options(f): - return _apply_options("common_args.yaml", f) +m2m_options=partial(_apply_options,"common_args.yaml") @click.group()