summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Techtonik <techtonik@gmail.com>2010-07-05 21:19:58 (GMT)
committerAnatoly Techtonik <techtonik@gmail.com>2010-07-05 21:19:58 (GMT)
commitd7631f5d615ee5d9df31558e6db624f7da20a21a (patch)
tree926338ae1d90a864085c48aab5504cf7661c0ae6
parent5b336b3694f21160594ac328a9f27bbc4d29a14a (diff)
downloadSCons-d7631f5d615ee5d9df31558e6db624f7da20a21a.zip
SCons-d7631f5d615ee5d9df31558e6db624f7da20a21a.tar.gz
SCons-d7631f5d615ee5d9df31558e6db624f7da20a21a.tar.bz2
remove Python 1.5.2 compatibility code from runtest.py
-rw-r--r--runtest.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/runtest.py b/runtest.py
index f838f4f..27e8867 100644
--- a/runtest.py
+++ b/runtest.py
@@ -344,24 +344,6 @@ def escape(s):
s = s.replace('\\', '\\\\')
return s
-# Set up lowest-common-denominator spawning of a process on both Windows
-# and non-Windows systems that works all the way back to Python 1.5.2.
-try:
- os.spawnv
-except AttributeError:
- def spawn_it(command_args):
- pid = os.fork()
- if pid == 0:
- os.execv(command_args[0], command_args)
- else:
- pid, status = os.waitpid(pid, 0)
- return status >> 8
-else:
- def spawn_it(command_args):
- command = command_args[0]
- command_args = list(map(escape, command_args))
- return os.spawnv(os.P_WAIT, command, command_args)
-
class Base(object):
def __init__(self, path, spe=None):
self.path = path
@@ -376,8 +358,9 @@ class Base(object):
class SystemExecutor(Base):
def execute(self):
- s = spawn_it(self.command_args)
- self.status = s
+ command = self.command_args[0]
+ command_args = [escape(arg) for arg in self.command_args]
+ s = self.status = os.spawnv(os.P_WAIT, command, command_args)
if s < 0 or s > 2:
sys.stdout.write("Unexpected exit status %d\n" % s)