Commit a3600a39 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fall back to os.spawnv is we don't have the subprocess module

parent fda45269
......@@ -4,13 +4,19 @@
import sys
import os
import subprocess
import string
import re
import traceback
import copy
import glob
have_subprocess = False
import subprocess
have_subprocess = True
print "Warning: subprocess not found, will fall back to spawnv"
from string import join
from testglobals import *
from testutil import *
......@@ -1052,11 +1058,19 @@ def runCmd( cmd ):
assert config.timeout_prog!=''
if config.timeout_prog != '':
# We use rather than os.spawnv as the latter
# We prefer to os.spawnv as the latter
# seems to send its arguments through a shell or something
# with the Windows (non-cygwin) python. An argument "a b c"
# turns into three arguments ["a", "b", "c"].
r =[config.timeout_prog, str(config.timeout), cmd])
# However, subprocess is new in python 2.4, so fall back to
# using spawnv if we don't have it
if have_subprocess:
r =[config.timeout_prog, str(config.timeout), cmd])
r = os.spawnv(os.P_WAIT, config.timeout_prog,
[config.timeout_prog, str(config.timeout), cmd])
r = os.system(cmd)
return r << 8
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment