summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/GenFds.py
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2018-06-25 18:31:36 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-06-27 16:33:28 +0800
commit86379ac48ba17c71d4623c57099b064b15118e21 (patch)
tree9ec107c195a28a4bdcf9b4734fa2c20b8c07ce32 /BaseTools/Source/Python/GenFds/GenFds.py
parent0d1f5b2b5dc3c1cf381be0a1ec8f960dc6029a93 (diff)
downloadedk2-86379ac48ba17c71d4623c57099b064b15118e21.tar.gz
edk2-86379ac48ba17c71d4623c57099b064b15118e21.tar.bz2
edk2-86379ac48ba17c71d4623c57099b064b15118e21.zip
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>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/GenFds.py')
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index 912e6c58f4..acd19e5276 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -27,7 +27,7 @@ from Workspace.WorkspaceDatabase import WorkspaceDatabase
from Workspace.BuildClassObject import PcdClassObject
import RuleComplexFile
from EfiSection import EfiSection
-import StringIO
+from io import BytesIO
import Common.TargetTxtClassObject as TargetTxtClassObject
import Common.ToolDefClassObject as ToolDefClassObject
from Common.DataType import *
@@ -542,13 +542,13 @@ class GenFds :
if GenFds.OnlyGenerateThisFv is not None and GenFds.OnlyGenerateThisFv.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict:
FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[GenFds.OnlyGenerateThisFv.upper()]
if FvObj is not None:
- Buffer = StringIO.StringIO()
+ Buffer = BytesIO()
FvObj.AddToBuffer(Buffer)
Buffer.close()
return
elif GenFds.OnlyGenerateThisFv is None:
for FvObj in GenFdsGlobalVariable.FdfParser.Profile.FvDict.values():
- Buffer = StringIO.StringIO('')
+ Buffer = BytesIO('')
FvObj.AddToBuffer(Buffer)
Buffer.close()
@@ -694,7 +694,7 @@ class GenFds :
def GenerateGuidXRefFile(BuildDb, ArchList, FdfParserObj):
GuidXRefFileName = os.path.join(GenFdsGlobalVariable.FvDir, "Guid.xref")
- GuidXRefFile = StringIO.StringIO('')
+ GuidXRefFile = BytesIO('')
GuidDict = {}
ModuleList = []
FileGuidList = []