diff options
author | Stephen D. Huston <shuston@apache.org> | 2010-11-04 22:47:10 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2010-11-04 22:47:10 +0000 |
commit | 2d7e11ce19afb8f1973c05db7331fa6ae0f4f75b (patch) | |
tree | a06f3719498696424eb3cd548b0abdf4db9b7960 | |
parent | 231d81265e4cdf41be214d5d40abfa8c7bed8cbe (diff) | |
download | qpid-python-2d7e11ce19afb8f1973c05db7331fa6ae0f4f75b.tar.gz |
Adjust for Windows which can't do Popen w/ close_fds. Also, when tearDown runs, clear stopem so previously torn down processes don't throw confusing exceptions later.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1031315 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/python/qpid/brokertest.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/python/qpid/brokertest.py b/qpid/python/qpid/brokertest.py index 165d2d3811..8cf05c8161 100644 --- a/qpid/python/qpid/brokertest.py +++ b/qpid/python/qpid/brokertest.py @@ -153,7 +153,10 @@ class Popen(subprocess.Popen): self.cmd = [ str(x) for x in cmd ] self.returncode = None self.expect = expect - subprocess.Popen.__init__(self, self.cmd, 0, None, subprocess.PIPE, subprocess.PIPE, subprocess.PIPE, close_fds=True) + try: + subprocess.Popen.__init__(self, self.cmd, 0, None, subprocess.PIPE, subprocess.PIPE, subprocess.PIPE, close_fds=True) + except ValueError: # Windows can't do close_fds + subprocess.Popen.__init__(self, self.cmd, 0, None, subprocess.PIPE, subprocess.PIPE, subprocess.PIPE) self.pname = "%s-%d" % (os.path.split(self.cmd[0])[1], self.pid) msg = "Process %s" % self.pname self.stdin = ExceptionWrapper(self.stdin, msg) @@ -487,6 +490,7 @@ class BrokerTest(TestCase): for p in self.stopem: try: p.stop() except Exception, e: err.append(str(e)) + self.stopem = [] # reset in case more processes start os.chdir(self.rootdir) if err: raise Exception("Unexpected process status:\n "+"\n ".join(err)) |