- 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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user