def scan_directory(project_tree, directory):
 try:
  return DirectoryListing(directory, tuple(project_tree.scandir(directory.path)), exists=True)
 except (IOError, OSError) as e:
  if (e.errno == errno.ENOENT):
   return DirectoryListing(directory, tuple(), exists=False)
  else:
   raise e

def scan_directory ( project_tree , directory ) : try : return DirectoryListing ( directory , tuple ( project_tree . scandir ( directory . path ) ) , exists = True ) except ( IOError , OSError ) as e : if ( e . errno == errno . ENOENT ) : return DirectoryListing ( directory , tuple ( ) , exists = False ) else : raise e
list stat objects directly below the given path .