message: Added python 3 compatibility to cpp_lint.py
diff: -#!/usr/bin/python2
  +#!/usr/bin/env python
  #
  # Copyright (c) 2009 Google Inc. All rights reserved.
  #
  @@ -52,6 +52,10 @@ import string
  import sys
  import unicodedata
  +import six
  +
  +from six import iteritems, itervalues
  +from six.moves import xrange
  _USAGE = """
  Syntax: cpp_lint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
  @@ -756,7 +760,7 @@ class _CppLintState(object):
  def PrintErrorCounts(self):
  """Print a summary of errors by category, and the total."""
  - for category, count in self.errors_by_category.iteritems():
  + for category, count in iteritems(self.errors_by_category):
  sys.stderr.write('Category \'%s\' errors found: %d\n' %
  (category, count))
  sys.stderr.write('Total errors found: %d\n' % self.error_count)
  @@ -3444,6 +3448,7 @@ def GetLineWidth(line):
  The width of the line in column positions, accounting for Unicode
  combining characters and wide characters.
  """
  + if six.PY2:
  if isinstance(line, unicode):
  width = 0
  for uc in unicodedata.normalize('NFC', line):
  @@ -3452,7 +3457,6 @@ def GetLineWidth(line):
  elif not unicodedata.combining(uc):
  width += 1
  return width
  - else:
  return len(line)
  @@ -3774,7 +3778,7 @@ def _GetTextInside(text, start_pattern):
  # Give opening punctuations to get the matching close-punctuations.
  matching_punctuation = {'(': ')', '{': '}', '[': ']'}
  - closing_punctuation = set(matching_punctuation.itervalues())
  + closing_punctuation = set(itervalues(matching_punctuation))
  # Find the position to start extracting text.
  match = re.search(start_pattern, text, re.M)
  @@ -4851,6 +4855,7 @@ def main():
  # Change stderr to write with replacement characters so we don't die
  # if we try to print something containing non-ASCII characters.
  + if six.PY2:
  sys.stderr = codecs.StreamReaderWriter(sys.stderr,
  codecs.getreader('utf8'),
  codecs.getwriter('utf8'),
  