Simplify this call to makedirs with destination.parent.

This commit is contained in:
Ethan Dalool 2020-09-06 09:32:12 -07:00
parent b34f6fafed
commit 26eaac7119

View file

@ -420,9 +420,8 @@ def copy_file(
return [destination, 0] return [destination, 0]
source_bytes = source.size 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): def handlehelper(path, mode):
try: try:
handle = open(path.absolute_path, mode) handle = open(path.absolute_path, mode)