_path.py 176 B

1234567
  1. import os
  2. def ensure_directory(path):
  3. """Ensure that the parent directory of `path` exists"""
  4. dirname = os.path.dirname(path)
  5. os.makedirs(dirname, exist_ok=True)