def _on_error(function, path, excinfo):
 try:
  if os.access(path, os.W_OK):
   raise OSError()
  os.chmod(path, stat.S_IWUSR)
  function(path)
 except OSError:
  try:
   if ((not os.path.isdir(path)) and (path[(-20):] != '.package-control-old')):
    os.rename(path, (path + '.package-control-old'))
  except OSError:
   pass

def _on_error ( function , path , excinfo ) : try : if os . access ( path , os . W_OK ) : raise OSError ( ) os . chmod ( path , stat . S_IWUSR ) function ( path ) except OSError : try : if ( ( not os . path . isdir ( path ) ) and ( path [ ( - 20 ) : ] != '.package-control-old' ) ) : os . rename ( path , ( path + '.package-control-old' ) ) except OSError : pass
error handler for shutil .