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 sys
|
||||
import re
|
||||
import StringIO
|
||||
from io import BytesIO
|
||||
|
||||
from optparse import OptionParser
|
||||
from optparse import make_option
|
||||
@ -455,8 +455,8 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
|
||||
except:
|
||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, "File open failed for %s" %OutputFile, None)
|
||||
|
||||
# Use a instance of StringIO to cache data
|
||||
fStringIO = StringIO.StringIO('')
|
||||
# Use a instance of BytesIO to cache data
|
||||
fStringIO = BytesIO('')
|
||||
|
||||
for Item in VfrUniOffsetList:
|
||||
if (Item[0].find("Strings") != -1):
|
||||
|
Reference in New Issue
Block a user