Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/gmv/gmvault_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import locale
import urllib
import chardet
import errno

import gmv.log_utils as log_utils
import gmv.conf.conf_helper
Expand Down Expand Up @@ -395,15 +396,17 @@ def contains_any(string, char_set):
return 1 in [c in string for c in char_set]

def makedirs(a_path):
""" my own version of makedir """

if os.path.isdir(a_path):
# it already exists so return
return
elif os.path.isfile(a_path):
raise OSError("a file with the same name as the desired dir, '%s', already exists."%(a_path))

os.makedirs(a_path)
"""
Create all the intermediate directories in a path.
Similar to the `mkdir -p` command.
"""
try:
os.makedirs(a_path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(a_path):
pass
else:
raise

def __rmgeneric(path, __func__):
""" private function that is part of delete_all_under """
Expand Down