def walk(top, func, arg):
 warnings.warnpy3k('In 3.x, os.path.walk is removed in favor of os.walk.')
 try:
  names = os.listdir(top)
 except os.error:
  return
 func(arg, top, names)
 for name in names:
  name = join(top, name)
  if isdir(name):
   walk(name, func, arg)

def walk ( top , func , arg ) : warnings . warnpy3k ( 'In 3.x, os.path.walk is removed in favor of os.walk.' ) try : names = os . listdir ( top ) except os . error : return func ( arg , top , names ) for name in names : name = join ( top , name ) if isdir ( name ) : walk ( name , func , arg )
a version of os .