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:
@ -19,7 +19,7 @@
|
||||
from __future__ import print_function
|
||||
import Common.LongFilePathOs as os
|
||||
import re
|
||||
import StringIO
|
||||
from io import BytesIO
|
||||
import sys
|
||||
import glob
|
||||
import time
|
||||
@ -1782,7 +1782,7 @@ class Build():
|
||||
if not Ma.IsLibrary:
|
||||
ModuleList[Ma.Guid.upper()] = Ma
|
||||
|
||||
MapBuffer = StringIO('')
|
||||
MapBuffer = BytesIO('')
|
||||
if self.LoadFixAddress != 0:
|
||||
#
|
||||
# Rebase module to the preferred memory address before GenFds
|
||||
@ -1940,7 +1940,7 @@ class Build():
|
||||
if not Ma.IsLibrary:
|
||||
ModuleList[Ma.Guid.upper()] = Ma
|
||||
|
||||
MapBuffer = StringIO('')
|
||||
MapBuffer = BytesIO('')
|
||||
if self.LoadFixAddress != 0:
|
||||
#
|
||||
# Rebase module to the preferred memory address before GenFds
|
||||
@ -2127,7 +2127,7 @@ class Build():
|
||||
#
|
||||
# Rebase module to the preferred memory address before GenFds
|
||||
#
|
||||
MapBuffer = StringIO('')
|
||||
MapBuffer = BytesIO('')
|
||||
if self.LoadFixAddress != 0:
|
||||
self._CollectModuleMapBuffer(MapBuffer, ModuleList)
|
||||
|
||||
|
Reference in New Issue
Block a user