From 64ec7a783b6f6938091710477e245d61e77091af Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Wed, 16 Oct 2024 09:45:37 -0700 Subject: [PATCH] Accept pathlib.Path in sh_{prepend|append}_paths --- metapkg/targets/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metapkg/targets/base.py b/metapkg/targets/base.py index 4eea371..1c1bc79 100644 --- a/metapkg/targets/base.py +++ b/metapkg/targets/base.py @@ -2105,12 +2105,12 @@ def sh_append_paths( self, args: dict[str, str | pathlib.Path | None], key: str, - paths: list[str] | tuple[str, ...], + paths: list[str | pathlib.Path] | tuple[str | pathlib.Path, ...], *, sep: str = os.pathsep, ignore_env: bool = False, ) -> None: - new_paths = self.sh_quote_flags(paths) + new_paths = self.sh_quote_flags([str(p) for p in paths]) self.sh_append_quoted_paths( args, key, new_paths, sep=sep, ignore_env=ignore_env ) @@ -2133,12 +2133,12 @@ def sh_prepend_paths( self, args: dict[str, str | pathlib.Path | None], key: str, - paths: list[str] | tuple[str, ...], + paths: list[str | pathlib.Path] | tuple[str | pathlib.Path, ...], *, sep: str = os.pathsep, ignore_env: bool = False, ) -> None: - new_paths = self.sh_quote_flags(paths) + new_paths = self.sh_quote_flags([str(p) for p in paths]) self.sh_prepend_quoted_paths( args, key, new_paths, sep=sep, ignore_env=ignore_env )