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 os
|
||||
from Common.RangeExpression import RangeExpression
|
||||
from Common.Misc import *
|
||||
from StringIO import StringIO
|
||||
from io import BytesIO
|
||||
from struct import pack
|
||||
from Common.DataType import *
|
||||
|
||||
@ -162,7 +162,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):
|
||||
Buffer += b
|
||||
realLength += 1
|
||||
|
||||
DbFile = StringIO()
|
||||
DbFile = BytesIO()
|
||||
if Phase == 'DXE' and os.path.exists(BinFilePath):
|
||||
BinFile = open(BinFilePath, "rb")
|
||||
BinBuffer = BinFile.read()
|
||||
|
Reference in New Issue
Block a user