BaseTools: fix the open file's read and write bugs
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
committed by
Yonghong Zhu
parent
fe3991d635
commit
a09f4c91f7
@ -245,7 +245,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
|
||||
|
||||
# save to file
|
||||
try:
|
||||
f = open (Target, 'wb')
|
||||
f = open (Target, 'w')
|
||||
except:
|
||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
|
||||
f.writelines(NewLines)
|
||||
@ -562,7 +562,7 @@ def TrimEdkSourceCode(Source, Target):
|
||||
CreateDirectory(os.path.dirname(Target))
|
||||
|
||||
try:
|
||||
f = open (Source, 'rb')
|
||||
f = open (Source, 'r')
|
||||
except:
|
||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
|
||||
# read whole file
|
||||
@ -581,7 +581,7 @@ def TrimEdkSourceCode(Source, Target):
|
||||
return
|
||||
|
||||
try:
|
||||
f = open (Target, 'wb')
|
||||
f = open (Target, 'w')
|
||||
except:
|
||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
|
||||
f.write(NewLines)
|
||||
|
Reference in New Issue
Block a user