From 72443dd25014a8b6209895640af36dec33da51e0 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Mon, 25 Jun 2018 18:31:26 +0800 Subject: BaseTools: Refactor python print statements Refactor print statements to be compatible with python 3. Based on "futurize -f libfuturize.fixes.fix_print_with_import" 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/UPT/UnitTest/InfBinarySectionTest.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py') diff --git a/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py b/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py index f3b43ee0bc..626f17426d 100644 --- a/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py +++ b/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py @@ -11,6 +11,7 @@ # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +from __future__ import print_function import os #import Object.Parser.InfObject as InfObject from Object.Parser.InfCommonObject import CurrentLine @@ -271,7 +272,7 @@ def PrepareTest(String): TempFile = open (FileName, "w") TempFile.close() except: - print "File Create Error" + print("File Create Error") CurrentLine = CurrentLine() CurrentLine.SetFileName("Test") CurrentLine.SetLineString(Item[0]) @@ -376,11 +377,11 @@ if __name__ == '__main__': try: InfBinariesInstance.SetBinary(Ver = Ver, ArchList = ArchList) except: - print "Test Failed!" + print("Test Failed!") AllPassedFlag = False if AllPassedFlag : - print 'All tests passed...' + print('All tests passed...') else: - print 'Some unit test failed!' + print('Some unit test failed!') -- cgit v1.2.3