def _os_walk_unicode(top):
 try:
  names = os.listdir(deunicodise(top))
 except:
  return
 (dirs, nondirs) = ([], [])
 for name in names:
  name = unicodise(name)
  if os.path.isdir(deunicodise(os.path.join(top, name))):
   if (not handle_exclude_include_walk_dir(top, name)):
    dirs.append(name)
  else:
   nondirs.append(name)
 (yield (top, dirs, nondirs))
 for name in dirs:
  new_path = os.path.join(top, name)
  if (not os.path.islink(deunicodise(new_path))):
   for x in _os_walk_unicode(new_path):
    (yield x)

def _os_walk_unicode ( top ) : try : names = os . listdir ( deunicodise ( top ) ) except : return ( dirs , nondirs ) = ( [ ] , [ ] ) for name in names : name = unicodise ( name ) if os . path . isdir ( deunicodise ( os . path . join ( top , name ) ) ) : if ( not handle_exclude_include_walk_dir ( top , name ) ) : dirs . append ( name ) else : nondirs . append ( name ) ( yield ( top , dirs , nondirs ) ) for name in dirs : new_path = os . path . join ( top , name ) if ( not os . path . islink ( deunicodise ( new_path ) ) ) : for x in _os_walk_unicode ( new_path ) : ( yield x )
reimplementation of pythons os .