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