mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +03:00
minor code adjustment
This commit is contained in:
parent
64f2afe585
commit
5a5b31ad53
|
@ -36,6 +36,8 @@ import posixpath
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
|
from subprocess import PIPE
|
||||||
|
from subprocess import Popen as execute
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
from tempfile import mkstemp
|
from tempfile import mkstemp
|
||||||
from xml.sax import parse
|
from xml.sax import parse
|
||||||
|
@ -1111,7 +1113,7 @@ def profile(profileOutputFile=None, imageOutputFile=None):
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
graphScriptPath = os.path.join(paths.SQLMAP_EXTRAS_PATH, 'gprof2dot', 'gprof2dot.py')
|
graphScriptPath = os.path.join(paths.SQLMAP_EXTRAS_PATH, 'gprof2dot', 'gprof2dot.py')
|
||||||
stderr = subprocess.Popen('%s %s -f pstats %s | dot -Tpng -o %s' % (sys.executable, graphScriptPath, profileOutputFile, imageOutputFile), shell=True, stderr=subprocess.PIPE).stderr.read()
|
stderr = execute('%s %s -f pstats %s | dot -Tpng -o %s' % (sys.executable, graphScriptPath, profileOutputFile, imageOutputFile), shell=True, stderr=PIPE).stderr.read()
|
||||||
|
|
||||||
if stderr or not os.path.exists(imageOutputFile):
|
if stderr or not os.path.exists(imageOutputFile):
|
||||||
errMsg = "there was an error while converting ('%s')" % stderr.strip()
|
errMsg = "there was an error while converting ('%s')" % stderr.strip()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user