Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,8 @@ def RepositoryName(self):
"""
fullname = self.FullName()
# XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory.
toplevel = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/')
toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) \
.replace('\\', '/').decode('utf-8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a little easier to read as:

toplevel = os.path.abspath(...)
toplevel = toplevel.decode('utf-8')

prefix = os.path.commonprefix([fullname, toplevel])
return fullname[len(prefix) + 1:]

Expand Down Expand Up @@ -6084,7 +6084,7 @@ def main():

_cpplint_state.ResetErrorCounts()
for filename in filenames:
ProcessFile(filename, _cpplint_state.verbose_level)
ProcessFile(filename.decode('utf-8'), _cpplint_state.verbose_level)
_cpplint_state.PrintErrorCounts()

sys.exit(_cpplint_state.error_count > 0)
Expand Down