Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a5b31a

Browse files
committed
minor code adjustment
1 parent 64f2afe commit 5a5b31a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/core/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
import subprocess
3737

3838
from StringIO import StringIO
39+
from subprocess import PIPE
40+
from subprocess import Popen as execute
3941
from tempfile import NamedTemporaryFile
4042
from tempfile import mkstemp
4143
from xml.sax import parse
@@ -1111,7 +1113,7 @@ def profile(profileOutputFile=None, imageOutputFile=None):
11111113
logger.info(infoMsg)
11121114

11131115
graphScriptPath = os.path.join(paths.SQLMAP_EXTRAS_PATH, 'gprof2dot', 'gprof2dot.py')
1114-
stderr = subprocess.Popen('%s %s -f pstats %s | dot -Tpng -o %s' % (sys.executable, graphScriptPath, profileOutputFile, imageOutputFile), shell=True, stderr=subprocess.PIPE).stderr.read()
1116+
stderr = execute('%s %s -f pstats %s | dot -Tpng -o %s' % (sys.executable, graphScriptPath, profileOutputFile, imageOutputFile), shell=True, stderr=PIPE).stderr.read()
11151117

11161118
if stderr or not os.path.exists(imageOutputFile):
11171119
errMsg = "there was an error while converting ('%s')" % stderr.strip()

0 commit comments

Comments
 (0)