diff --git a/clang/utils/hmaptool/hmaptool b/clang/utils/hmaptool/hmaptool --- a/clang/utils/hmaptool/hmaptool +++ b/clang/utils/hmaptool/hmaptool @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import, division, print_function import json @@ -9,8 +9,8 @@ ### -k_header_magic_LE = 'pamh' -k_header_magic_BE = 'hmap' +k_header_magic_LE = b'pamh' +k_header_magic_BE = b'hmap' def hmap_hash(str): """hash(str) -> int @@ -83,7 +83,7 @@ if len(strtable) != strtable_size: raise SystemExit("error: %s: unable to read complete string table"%( path,)) - if strtable[-1] != '\0': + if strtable[-1] != 0: raise SystemExit("error: %s: invalid string table in headermap" % ( path,)) @@ -98,7 +98,7 @@ if idx >= len(self.strtable): raise SystemExit("error: %s: invalid string index" % ( path,)) - end_idx = self.strtable.index('\0', idx) + end_idx = self.strtable.index(0, idx) return self.strtable[idx:end_idx] @property