pwtools.common.makedirs

pwtools.common.makedirs(path)[source]

Same as os.makedirs() but silently skips empty paths.

The common use case is when we always create a path for a file w/o knowing beforehand whether we actually have a path.

>>> fn = 'foo.pk'
>>> makedirs(os.path.dirname(fn))