def lock_parent_directory(filename, timeout=10):
 return lock_path(os.path.dirname(filename), timeout=timeout)

def lock_parent_directory ( filename , timeout = 10 ) : return lock_path ( os . path . dirname ( filename ) , timeout = timeout )
context manager that acquires a lock on the parent directory of the given file path .