From 174a9d3cc8f74f7a731ac5f16ce6864c8eb359ec Mon Sep 17 00:00:00 2001 From: Zhijux Fan Date: Mon, 17 Dec 2018 15:18:01 +0800 Subject: BaseTools/UPT:merge UPT Tool use Python2 and Python3 In UPT Tool,merge python2 and python3 Cc: Bob Feng Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Tested-by: Laszlo Ersek Tested-by: Ard Biesheuvel Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- BaseTools/Source/Python/UPT/Library/UniClassObject.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/UPT/Library/UniClassObject.py') diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py index cd575d5a34..bd7804b753 100644 --- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py +++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py @@ -119,10 +119,12 @@ def UniToHexList(Uni): # @retval NewUni: The converted unicode string # def ConvertSpecialUnicodes(Uni): - NewUni = Uni + OldUni = NewUni = Uni NewUni = NewUni.replace(u'\u00A9', '(c)') NewUni = NewUni.replace(u'\u00AE', '(r)') NewUni = NewUni.replace(u'\u2122', '(tm)') + if OldUni == NewUni: + NewUni = OldUni return NewUni ## GetLanguageCode1766 @@ -513,7 +515,7 @@ class UniFileClassObject(object): FileIn[LineCount-1] = Line FileIn[LineCount] = '\r\n' LineCount -= 1 - for Index in xrange (LineCount + 1, len (FileIn) - 1): + for Index in range (LineCount + 1, len (FileIn) - 1): if (Index == len(FileIn) -1): FileIn[Index] = '\r\n' else: -- cgit v1.2.3