Skip to content

Commit 76b65a1

Browse files
author
David Souther
committed
Changes locally testing
1 parent 04dfd3e commit 76b65a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8
1+
3.9

aws_doc_sdk_examples_tools/fs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def list(self, path: Path) -> List[Path]:
5252
def copytree(self, source: Path, dest: Path):
5353
pass
5454

55+
5556
class PathFs(Fs):
5657
def glob(self, path: Path, glob: str) -> Generator[Path, None, None]:
5758
return path.glob(glob)
@@ -65,6 +66,7 @@ def readlines(self, path: Path, encoding: str = "utf-8") -> List[str]:
6566
return file.readlines()
6667

6768
def write(self, path: Path, content: str):
69+
self.mkdir(path.parent)
6870
with path.open("w", encoding="utf-8") as file:
6971
file.write(content)
7072

@@ -82,9 +84,9 @@ def list(self, path: Path) -> List[Path]:
8284
if self.stat(path).is_file:
8385
return []
8486
return [path / name for name in listdir(path)]
85-
87+
8688
def copytree(self, source: Path, dest: Path):
87-
shutil.copytree(source, dest)
89+
shutil.copytree(source, dest, dirs_exist_ok=True)
8890

8991

9092
class RecordFs(Fs):

0 commit comments

Comments
 (0)