OSDN Git Service

simpleperf: fix is_elf_file.
authorYabin Cui <yabinc@google.com>
Thu, 22 Aug 2019 17:50:19 +0000 (10:50 -0700)
committerYabin Cui <yabinc@google.com>
Thu, 22 Aug 2019 17:56:44 +0000 (10:56 -0700)
commit0e50ea422f283a277a598f9aa12a40c01c515a79
treeef80d719e23e63ddb98b09f71d7ca0a92875727d
parent5ff5b91fdc0b07bebaaecd76e47d5c57571ca5ad
simpleperf: fix is_elf_file.

When running by python3, is_elf_file() decodes first 4 bytes of
a file, which may cause UnicodeDecodeError.

Bug: none
Test: run test.py TestTools.test_is_elf_file.
Change-Id: Ie19e4869f876bb92155d849c814c8f39989c443b
simpleperf/scripts/test.py
simpleperf/scripts/utils.py