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/DecParserTest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py') diff --git a/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py b/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py index 8b4ece2617..5f0abcafef 100644 --- a/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py +++ b/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.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 unittest @@ -66,7 +67,7 @@ def TestTemplate(TestString, TestFunc): # Close file f.close() except: - print 'Can not create temporary file [%s]!' % Path + print('Can not create temporary file [%s]!' % Path) exit(-1) # Call test function to test @@ -279,6 +280,6 @@ if __name__ == '__main__': unittest.FunctionTestCase(TestDecPcd).runTest() unittest.FunctionTestCase(TestDecUserExtension).runTest() - print 'All tests passed...' + print('All tests passed...') -- cgit v1.2.3