From 125681da18fed478eddf1956bb9a088e3b1bea96 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 7 Nov 2021 18:55:28 -0800 Subject: [PATCH] Let pathclass.join take spawn_kwargs. --- voussoirkit/pathclass.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/voussoirkit/pathclass.py b/voussoirkit/pathclass.py index f789c57..25d6a6a 100644 --- a/voussoirkit/pathclass.py +++ b/voussoirkit/pathclass.py @@ -242,6 +242,7 @@ class Path: def is_directory(self): return os.path.isdir(self.absolute_path) + # Aliases for your convenience. is_dir = is_directory is_folder = is_directory @@ -253,16 +254,15 @@ class Path: def is_link(self): return os.path.islink(self.absolute_path) - def join(self, subpath): + def join(self, subpath, **spawn_kwargs): if not isinstance(subpath, str): raise TypeError('subpath must be a string') path = os.path.join(self.absolute_path, subpath) - return self.spawn(path) + return self.spawn(path, **spawn_kwargs) def listdir(self): children = os.listdir(self.absolute_path) - children = [os.path.join(self.absolute_path, child) for child in children] - children = [self.spawn(child, _case_correct=self._case_correct) for child in children] + children = [self.join(child, _case_correct=self._case_correct) for child in children] return children def makedirs(self, mode=0o777, exist_ok=False):