--- a/scripts/endpoints_checker.py (original) +++ b/scripts/endpoints_checker.py (refactored) @@ -64,8 +64,8 @@ strippedContent = RemoveCPPComments(content); match = ScanContent(strippedContent); if match: - print inputFile; - print "..." + strippedContent[match.start() : match.end()] + "..."; + print(inputFile); + print("..." + strippedContent[match.start() : match.end()] + "..."); return True; return False; @@ -109,7 +109,7 @@ assert ScanContent("\"cn-north-2 doesn't exist\"") == None; ###################Test End###################################### -print "Start checking hard coded endpoints in source files..."; +print("Start checking hard coded endpoints in source files..."); exitCode = 0; RootDir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))); for root, dirnames, fileNames in os.walk(RootDir): @@ -117,5 +117,5 @@ if fileName.endswith(('.h', '.cpp')): targetFile = os.path.join(root, fileName); exitCode |= CheckFile(targetFile); -print "Finished checking hard coded endpoints in source files with exit code",exitCode,"."; +print("Finished checking hard coded endpoints in source files with exit code",exitCode,"."); exit(exitCode);