- Rewrite subprocess access to the newer subprocess.Popen module. This seems to work just fine for Windows XP, at least.

This commit is contained in:
Cas Cremers
2007-05-19 14:29:32 +02:00
parent ef2af6b097
commit 688416a351
2 changed files with 34 additions and 13 deletions

View File

@@ -11,6 +11,12 @@ import os.path
import sys
import StringIO
import tempfile
try:
from subprocess import Popen
AvailablePopen = True
except:
AvailablePopen = False
#---------------------------------------------------------------------------
@@ -192,6 +198,7 @@ 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
@@ -226,7 +233,11 @@ class Scyther(object):
##print self.cmd
# Start the process
os.system(self.cmd)
if AvailablePopen:
p = Popen(self.cmd, shell=False)
sts = p.wait()
else:
os.system(self.cmd)
# reseek
fhe = os.fdopen(fde)