Make ensure_directory() work with paths with no directory component

pull/484/head
Mike Lang 2 days ago
parent 854b5723bb
commit 9e8cb7bee8

@ -106,7 +106,8 @@ def ensure_directory(path):
"""Create directory that contains path, as well as any parent directories,
if they don't already exist."""
dir_path = os.path.dirname(path)
os.makedirs(dir_path, exist_ok=True)
if dir_path != "":
os.makedirs(dir_path, exist_ok=True)
def jitter(interval):

Loading…
Cancel
Save