@synchronized(DIR_LOCK)
def cleanup_empty_directories(path):
 path = os.path.normpath(path)
 while 1:
  repeat = False
  for (root, dirs, files) in os.walk(path, topdown=False):
   if ((not dirs) and (not files) and (root != path)):
    try:
     remove_dir(root)
     repeat = True
    except:
     pass
  if (not repeat):
   break
 try:
  remove_dir(path)
 except:
  pass

@ synchronized ( DIR_LOCK ) def cleanup_empty_directories ( path ) : path = os . path . normpath ( path ) while 1 : repeat = False for ( root , dirs , files ) in os . walk ( path , topdown = False ) : if ( ( not dirs ) and ( not files ) and ( root != path ) ) : try : remove_dir ( root ) repeat = True except : pass if ( not repeat ) : break try : remove_dir ( path ) except : pass
remove all empty folders inside path .