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:
@ -28,7 +28,7 @@ import hashlib
|
||||
import subprocess
|
||||
import threading
|
||||
from datetime import datetime
|
||||
from StringIO import StringIO
|
||||
from io import BytesIO
|
||||
from Common import EdkLogger
|
||||
from Common.Misc import SaveFileOnChange
|
||||
from Common.Misc import GuidStructureByteArrayToGuidString
|
||||
@ -2169,7 +2169,7 @@ class BuildReport(object):
|
||||
def GenerateReport(self, BuildDuration, AutoGenTime, MakeTime, GenFdsTime):
|
||||
if self.ReportFile:
|
||||
try:
|
||||
File = StringIO('')
|
||||
File = BytesIO('')
|
||||
for (Wa, MaList) in self.ReportList:
|
||||
PlatformReport(Wa, MaList, self.ReportType).GenerateReport(File, BuildDuration, AutoGenTime, MakeTime, GenFdsTime, self.ReportType)
|
||||
Content = FileLinesSplit(File.getvalue(), gLineMaxLength)
|
||||
|
Reference in New Issue
Block a user