diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index ad55671080..4be7957138 100755 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1635,7 +1635,7 @@ class PeImageClass(): ByteArray = array.array('B') ByteArray.fromfile(PeObject, 4) # PE signature should be 'PE\0\0' - if ByteArray.tostring() != b'PE\0\0': + if ByteArray.tolist() != [ord('P'), ord('E'), 0, 0]: self.ErrorInfo = self.FileName + ' has no valid PE signature PE00' return