From a44db8a7b9f2c7bf93ee3777eae3b9caecdfc491 Mon Sep 17 00:00:00 2001 From: Anatoly Techtonik Date: Mon, 5 Jul 2010 21:19:58 +0000 Subject: remove Python 1.5.2 compatibility code from runtest.py --- runtest.py | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'runtest.py') diff --git a/runtest.py b/runtest.py index f838f4f2..27e88675 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) -- cgit v1.2.1