From 439a95bde703cf5afb964e6a5d56137e362685f6 Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Fri, 22 Sep 2017 22:58:46 +0000 Subject: [PATCH] [Analyzer] Fix minor errors in python scripts. llvm-svn: 314042 --- clang/utils/analyzer/SATestBuild.py | 1 - clang/utils/analyzer/SATestUpdateDiffs.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/clang/utils/analyzer/SATestBuild.py b/clang/utils/analyzer/SATestBuild.py index 8d44b75729e7..a053f5fb013b 100755 --- a/clang/utils/analyzer/SATestBuild.py +++ b/clang/utils/analyzer/SATestBuild.py @@ -485,7 +485,6 @@ def checkBuild(SBOutputDir): % (NumOfFailuresInSummary,)) # TODO: Add a line "See the results folder for more." - FailuresCopied = NumOfFailuresInSummary Idx = 0 for FailLogPathI in Failures: if Idx >= NumOfFailuresInSummary: diff --git a/clang/utils/analyzer/SATestUpdateDiffs.py b/clang/utils/analyzer/SATestUpdateDiffs.py index 994fd1f07493..df836b10f84f 100755 --- a/clang/utils/analyzer/SATestUpdateDiffs.py +++ b/clang/utils/analyzer/SATestUpdateDiffs.py @@ -4,8 +4,9 @@ Update reference results for static analyzer. """ -from subprocess import check_call, check_output, CalledProcessError -import csv +import SATestBuild + +from subprocess import check_call import os import sys @@ -35,8 +36,7 @@ def updateReferenceResults(ProjName, ProjBuildMode): runCmd('cp -r "%s" "%s"' % (CreatedResultsPath, RefResultsPath,)) # Run cleanup script. - with open(SATestBuild.getBuildLogPath(RefResultsPath), "wb+") - as PBuildLogFile: + with open(SATestBuild.getBuildLogPath(RefResultsPath), "wb+") as PBuildLogFile: SATestBuild.runCleanupScript(ProjDir, PBuildLogFile) SATestBuild.normalizeReferenceResults(ProjDir, RefResultsPath, ProjBuildMode) @@ -52,7 +52,7 @@ def updateReferenceResults(ProjName, ProjBuildMode): def main(argv): if len(argv) == 2 and argv[1] in ('-h', '--help'): print >> sys.stderr, "Update static analyzer reference results based "\ - "\non the previous run of SATestBuild.py.\n" + "\non the previous run of SATestBuild.py.\n"\ "\nN.B.: Assumes that SATestBuild.py was just run." sys.exit(-1)