def _maybe_create_dir(path):
    "Create directory (and parents) if they don't exist."
    try:
        os.makedirs(path)
    except OSError:
        if (not os.path.isdir(path)):
            raise
Create directory (and parents) if they don't exist.
def _maybe_create_dir(path):
    
    try:
        os.makedirs(path)
    except OSError:
        if (not os.path.isdir(path)):
            raise