code: def RemoveEmptyDirectoryTree(path, silent = False, recursion = 0):
    
    if not silent and recursion is 0:
      goodlogging.Log.Info("UTIL", "Starting removal of empty directory tree at: {0}".format(path))
    try:
      os.rmdir(path)
    except OSError:
      if not silent:
        goodlogging.Log.Info("UTIL", "Removal of empty directory tree terminated at: {0}".format(path))
      return
    else:
      if not silent:
        goodlogging.Log.Info("UTIL", "Directory deleted: {0}".format(path))
      RemoveEmptyDirectoryTree(os.path.dirname(path), silent, recursion + 1)
docs: Delete tree of empty directories.
  
    Parameters
    ----------
      path : string
        Path to root of directory tree.
  
      silent : boolean [optional: default = False]
        Turn off log output.
  
      recursion : int [optional: default = 0]
        Indicates level of recursion.