NativeHeapDumpViewer: Python 3 compatibility
Fix some minor compat issues. Also clean up file close. Test: native_heapdump_viewer_tests Change-Id: Ic43b5cc61f26dd11fffe4e9b7a06056e4ed1c676
This commit is contained in:
@@ -27,7 +27,7 @@ class NativeHeapdumpViewerTest(unittest.TestCase):
|
||||
|
||||
def CreateTmpFile(self, contents):
|
||||
fd, self._tmp_file_name = tempfile.mkstemp()
|
||||
os.write(fd, contents)
|
||||
os.write(fd, contents.encode())
|
||||
os.close(fd)
|
||||
return self._tmp_file_name
|
||||
|
||||
@@ -36,7 +36,7 @@ class NativeHeapdumpViewerTest(unittest.TestCase):
|
||||
try:
|
||||
os.unlink(self._tmp_file_name)
|
||||
except Exception:
|
||||
print "Failed to delete " + heap
|
||||
print("Failed to delete %s" % (heap))
|
||||
|
||||
class GetNumFieldValidTest(NativeHeapdumpViewerTest):
|
||||
_map_data = """
|
||||
|
||||
Reference in New Issue
Block a user