From 050015d2bbf14b1610b9b5cb7c947def06c8a61b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 21 May 2010 13:15:21 +0000 Subject: [PATCH] minor adjustments --- lib/core/common.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index b68467ca8..ec52e9650 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1109,14 +1109,16 @@ def profile(profileOutputFile=None, imageOutputFile=None): cProfile.run("start()", profileOutputFile) - infoMsg = "converting profile data into a graph image, %s" % imageOutputFile + infoMsg = "converting profile data into a graph image '%s'" % imageOutputFile logger.info(infoMsg) graphScriptPath = os.path.join(paths.SQLMAP_EXTRAS_PATH, 'gprof2dot', 'gprof2dot.py') - stderr = execute('%s %s -f pstats %s | dot -Tpng -o %s' % (sys.executable, graphScriptPath, profileOutputFile, imageOutputFile), shell=True, stderr=PIPE).stderr.read() + process = execute('%s %s -f pstats %s | dot -Tpng -o %s' % (sys.executable, graphScriptPath, profileOutputFile, imageOutputFile), shell=True, stdout=None, stderr=PIPE) + pollProcess(process) + payloadStderr = process.communicate()[1] - if stderr or not os.path.exists(imageOutputFile): - errMsg = "there was an error while converting ('%s')" % stderr.strip() + if payloadStderr or not os.path.exists(imageOutputFile): + errMsg = "there was an error while converting ('%s'), " % payloadStderr.strip() errMsg += "but you can still find raw profile data " errMsg += "inside file '%s'" % profileOutputFile logger.error(errMsg)