BaseTools: Replace StringIO.StringIO with io.BytesIO
Replace StringIO.StringIO with io.BytesIO to be compatible with python3. This commit also removes "import StringIO" from those python scripts that don't really use it. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
#
|
||||
import Common.LongFilePathOs as os
|
||||
import subprocess
|
||||
import StringIO
|
||||
from io import BytesIO
|
||||
from struct import *
|
||||
|
||||
import Ffs
|
||||
@ -265,7 +265,7 @@ class FV (FvClassObject):
|
||||
#
|
||||
self.InfFileName = os.path.join(GenFdsGlobalVariable.FvDir,
|
||||
self.UiFvName + '.inf')
|
||||
self.FvInfFile = StringIO.StringIO()
|
||||
self.FvInfFile = BytesIO()
|
||||
|
||||
#
|
||||
# Add [Options]
|
||||
@ -407,7 +407,7 @@ class FV (FvClassObject):
|
||||
#
|
||||
if TotalSize > 0:
|
||||
FvExtHeaderFileName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiFvName + '.ext')
|
||||
FvExtHeaderFile = StringIO.StringIO()
|
||||
FvExtHeaderFile = BytesIO()
|
||||
FvExtHeaderFile.write(Buffer)
|
||||
Changed = SaveFileOnChange(FvExtHeaderFileName, FvExtHeaderFile.getvalue(), True)
|
||||
FvExtHeaderFile.close()
|
||||
|
Reference in New Issue
Block a user