mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
BaseTool: Fixed incremental rebuild issue.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1540 This issue in introduced by commit d943b0c339fe3d35ffdf9f580ccb7a55915c6854 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:
parent
4247c24fba
commit
f747640bf3
@ -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:
|
||||
|
@ -155,15 +155,14 @@ def GetDependencyList(FileStack, SearchPathList):
|
||||
if len(FileContent) == 0:
|
||||
continue
|
||||
|
||||
if FileContent[0] == 0xff or FileContent[0] == 0xfe:
|
||||
FileContent = FileContent.decode('utf-16')
|
||||
IncludedFileList = gIncludePattern.findall(FileContent)
|
||||
else:
|
||||
try:
|
||||
FileContent = str(FileContent)
|
||||
IncludedFileList = gIncludePattern.findall(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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user