- Factored out the safe external command process. It turns out that the shell should not be used under windows Popen, but on the other hand is must be used under Linux.

This commit is contained in:
Cas Cremers
2007-05-19 15:32:58 +02:00
parent 23931281d0
commit f47c1e7e5e
3 changed files with 28 additions and 25 deletions

View File

@@ -11,11 +11,6 @@ import os.path
import sys
import StringIO
import tempfile
try:
from subprocess import Popen
AvailablePopen = True
except:
AvailablePopen = False
#---------------------------------------------------------------------------
@@ -198,7 +193,6 @@ class Scyther(object):
output -- string which is the real output
errors -- string which captures the errors
"""
global AvailablePopen
if self.program == None:
raise Error.NoBinaryError
@@ -233,11 +227,7 @@ class Scyther(object):
##print self.cmd
# Start the process
if AvailablePopen:
p = Popen(self.cmd, shell=False)
sts = p.wait()
else:
os.system(self.cmd)
safeCommand(self.cmd)
# reseek
fhe = os.fdopen(fde)