From 0cd87f9f496a6466e3798311cf45697b08cbdc9b Mon Sep 17 00:00:00 2001 From: xwx1135370 Date: Wed, 28 Aug 2024 14:35:43 +0800 Subject: [PATCH] [R&D][Build]Fix magic_number not defined Issue:https://gitee.com/openharmony/third_party_llvm-project/issues/IAMNHS?from=project-issue Test:python3 ./toolchain/llvm-project/llvm-build/build-ohos-aarch64.py --strip --build-python Signed-off-by: xwx1135370 --- llvm-build/python_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm-build/python_builder.py b/llvm-build/python_builder.py index cda90f262089..92190baac7b8 100755 --- a/llvm-build/python_builder.py +++ b/llvm-build/python_builder.py @@ -189,7 +189,7 @@ class PythonBuilder: def _is_elf_file(self, file_path: Path) -> None: with open(file_path, 'rb') as f: magic_numbers = f.read(4) - hex_magic_number = binascii.hexlify(magic_number).decode('utf-8') + hex_magic_number = binascii.hexlify(magic_numbers).decode('utf-8') if hex_magic_number == '7f454c46': return True else: -- Gitee