def _handle_blacklist(blacklist, dirnames, filenames):
 for norecurs in blacklist:
  if (norecurs in dirnames):
   dirnames.remove(norecurs)
  elif (norecurs in filenames):
   filenames.remove(norecurs)

def _handle_blacklist ( blacklist , dirnames , filenames ) : for norecurs in blacklist : if ( norecurs in dirnames ) : dirnames . remove ( norecurs ) elif ( norecurs in filenames ) : filenames . remove ( norecurs )
remove files/directories in the black list dirnames/filenames are usually from os .