From 26eaac71198b362821db17d99713d16f3ad84a4c Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 6 Sep 2020 09:32:12 -0700 Subject: [PATCH] Simplify this call to makedirs with destination.parent. --- voussoirkit/spinal.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/voussoirkit/spinal.py b/voussoirkit/spinal.py index 256d10a..0fb3f79 100644 --- a/voussoirkit/spinal.py +++ b/voussoirkit/spinal.py @@ -420,9 +420,8 @@ def copy_file( return [destination, 0] source_bytes = source.size - destination_location = os.path.split(destination.absolute_path)[0] - os.makedirs(destination_location, exist_ok=True) + os.makedirs(destination.parent.absolute_path, exist_ok=True) def handlehelper(path, mode): try: handle = open(path.absolute_path, mode)