From 86379ac48ba17c71d4623c57099b064b15118e21 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Mon, 25 Jun 2018 18:31:36 +0800 Subject: 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 Cc: Liming Gao Signed-off-by: Gary Lin Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Trim/Trim.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/Trim/Trim.py') diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py index 97f4e87587..76944c0e25 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -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): -- cgit v1.2.3