def compare_dirs(dir1, dir2):
 dc = filecmp.dircmp(dir1, dir2)
 if ((len(dc.funny_files) > 0) or (len(dc.left_only) > 0) or (len(dc.right_only) > 0) or (len(dc.diff_files) > 0)):
  dc.report()
  return False
 else:
  for subdir in dc.common_dirs:
   if (not compare_dirs(((dir1 + '\\') + subdir), ((dir2 + '\\') + subdir))):
    return False
  return True

def compare_dirs ( dir1 , dir2 ) : dc = filecmp . dircmp ( dir1 , dir2 ) if ( ( len ( dc . funny_files ) > 0 ) or ( len ( dc . left_only ) > 0 ) or ( len ( dc . right_only ) > 0 ) or ( len ( dc . diff_files ) > 0 ) ) : dc . report ( ) return False else : for subdir in dc . common_dirs : if ( not compare_dirs ( ( ( dir1 + '\\' ) + subdir ) , ( ( dir2 + '\\' ) + subdir ) ) ) : return False return True
tests whether two folders .