def RemoveTrailingSlashes(path):
  """Removes trailing forward slashes from the path.

  We expect unix style path separators (/).  Gyp passes unix style
  separators even in windows so this is okay.

  Args:
    path: The path to strip trailing slashes from.

  Returns:
    The path with trailing slashes removed.
  """
  # Special case a single trailing slash since '/' != '' in a path.
  if path == '/':
    return path

  return path.rstrip('/')