def strip_files(files, argv_max=(256 * 1024)):
 while files:
  cmd = list(STRIPCMD)
  pathlen = sum(((len(s) + 1) for s in cmd))
  while ((pathlen < argv_max) and files):
   f = files.pop()
   cmd.append(f)
   pathlen += (len(f) + 1)
  if (len(cmd) > len(STRIPCMD)):
   all_files = cmd[len(STRIPCMD):]
   unwritable_files = tuple(filter(None, ((None if os.access(x, os.W_OK) else (x, os.stat(x).st_mode)) for x in all_files)))
   [os.chmod(x, (stat.S_IWRITE | old_mode)) for (x, old_mode) in unwritable_files]
   subprocess.check_call(cmd)
   [os.chmod(x, old_mode) for (x, old_mode) in unwritable_files]

def strip_files ( files , argv_max = ( 256 * 1024 ) ) : while files : cmd = list ( STRIPCMD ) pathlen = sum ( ( ( len ( s ) + 1 ) for s in cmd ) ) while ( ( pathlen < argv_max ) and files ) : f = files . pop ( ) cmd . append ( f ) pathlen += ( len ( f ) + 1 ) if ( len ( cmd ) > len ( STRIPCMD ) ) : all_files = cmd [ len ( STRIPCMD ) : ] unwritable_files = tuple ( filter ( None , ( ( None if os . access ( x , os . W_OK ) else ( x , os . stat ( x ) . st_mode ) ) for x in all_files ) ) ) [ os . chmod ( x , ( stat . S_IWRITE | old_mode ) ) for ( x , old_mode ) in unwritable_files ] subprocess . check_call ( cmd ) [ os . chmod ( x , old_mode ) for ( x , old_mode ) in unwritable_files ]
strip a list of files .