Skip to content

Commit 878df24

Browse files
committed
python2 compatible makedirs
1 parent b707937 commit 878df24

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

qiita_client/qiita_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,8 @@ def fetch_file_from_central(self, filepath, prefix=None):
784784
if self._plugincoupling == 'filesystem':
785785
if (prefix is not None) and (prefix != ""):
786786
# create necessary directory locally
787-
os.makedirs(os.path.dirname(target_filepath), exist_ok=True)
787+
if not os.path.exists(os.path.dirname(target_filepath)):
788+
os.makedirs(os.path.dirname(target_filepath))
788789

789790
shutil.copyfile(filepath, target_filepath)
790791

@@ -803,7 +804,8 @@ def fetch_file_from_central(self, filepath, prefix=None):
803804
rettype='content')
804805

805806
# create necessary directory locally
806-
os.makedirs(os.path.dirname(target_filepath), exist_ok=True)
807+
if not os.path.exists(os.path.dirname(target_filepath)):
808+
os.makedirs(os.path.dirname(target_filepath))
807809

808810
# write retrieved file content
809811
with open(target_filepath, 'wb') as f:

0 commit comments

Comments
 (0)