From ba2069cfbbed1bdc0b32dd6853aada258755884a Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Wed, 12 Dec 2012 17:33:12 +0300 Subject: os.spawnv is here since Python 1.6, removing compatibility code --- runtest.py | 21 +++++---------------- test/Deprecated/SourceCode/Perforce/Perforce.py | 9 ++------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/runtest.py b/runtest.py index a88cfd2..55a16f5 100644 --- a/runtest.py +++ b/runtest.py @@ -390,22 +390,11 @@ if use_subprocess: else: has_subprocess = False # 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 (None, None, status >> 8) - else: - def spawn_it(command_args): - command = command_args[0] - command_args = [escape(c) for c in command_args] - return (None, None, os.spawnv(os.P_WAIT, command, command_args)) + # and non-Windows systems that works all the way back to Python 1.6 + def spawn_it(command_args): + command = command_args[0] + command_args = [escape(c) for c in command_args] + return (None, None, os.spawnv(os.P_WAIT, command, command_args)) class Base(object): def __init__(self, path, spe=None): diff --git a/test/Deprecated/SourceCode/Perforce/Perforce.py b/test/Deprecated/SourceCode/Perforce/Perforce.py index d732b57..ebf9cfb 100644 --- a/test/Deprecated/SourceCode/Perforce/Perforce.py +++ b/test/Deprecated/SourceCode/Perforce/Perforce.py @@ -85,13 +85,8 @@ class TestPerforce(TestSCons.TestSCons): # We don't use self.run() because the TestCmd logic will hang # waiting for the daemon to exit, even when we pass it # the -d option. - try: - spawnv = os.spawnv - except AttributeError: - os.system(' '.join(args)) - else: - spawnv(os.P_NOWAIT, self.p4d, args) - self.sleep(2) + os.spawnv(os.P_NOWAIT, self.p4d, args) + self.sleep(2) else: import socket s = socket.socket() -- cgit v0.12