stderr=PBuildLogFile,
stdout=PBuildLogFile,
shell=True)
- except:
- print "Error: scan-build failed. See ", PBuildLogFile.name,\
- " for details."
- raise
+ except CalledProcessError:
+ print "Error: scan-build failed. Its output was: "
+ PBuildLogFile.seek(0)
+ shutil.copyfileobj(PBuildLogFile, sys.stdout)
+ sys.exit(1)
def runAnalyzePreprocessed(Dir, SBOutputDir, Mode):
os.makedirs(os.path.join(SBOutputDir, LogFolderName))
# Build and analyze the project.
- with open(BuildLogPath, "wb+") as PBuildLogFile:
+ with open(BuildLogPath, "r+b") as PBuildLogFile:
if (ProjectBuildMode == 1):
downloadAndPatch(Dir, PBuildLogFile)
runCleanupScript(Dir, PBuildLogFile)