BaseTool: Fixed incremental rebuild issue.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1540
This issue in introduced by commit
d943b0c339
To convert bytes to string, we need to use bytes.decode()
instead of using str(bytes).
If the source file is not a txt file, ignore that file.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -1045,14 +1045,14 @@ cleanlib:
|
||||
EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=F.Path + "\n\t" + str(X))
|
||||
if len(FileContent) == 0:
|
||||
continue
|
||||
|
||||
if FileContent[0] == 0xff or FileContent[0] == 0xfe:
|
||||
FileContent = FileContent.decode('utf-16')
|
||||
else:
|
||||
try:
|
||||
FileContent = str(FileContent)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if FileContent[0] == 0xff or FileContent[0] == 0xfe:
|
||||
FileContent = FileContent.decode('utf-16')
|
||||
else:
|
||||
FileContent = FileContent.decode()
|
||||
except:
|
||||
# The file is not txt file. for example .mcb file
|
||||
continue
|
||||
IncludedFileList = gIncludePattern.findall(FileContent)
|
||||
|
||||
for Inc in IncludedFileList:
|
||||
|
Reference in New Issue
Block a user