summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2010-11-04 22:47:10 +0000
committerStephen D. Huston <shuston@apache.org>2010-11-04 22:47:10 +0000
commit0cfcc7eb593f62473cc0cd50deb9fe8d97608272 (patch)
treee879f79b0669395ab8f239efc5a0927c2fb662cf /python
parentdca1705e5dc12f3ab3eb0b2d706a4f281f778abb (diff)
downloadqpid-python-0cfcc7eb593f62473cc0cd50deb9fe8d97608272.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/qpid@1031315 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/brokertest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/qpid/brokertest.py b/python/qpid/brokertest.py
index 165d2d3811..8cf05c8161 100644
--- a/python/qpid/brokertest.py
+++ b/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))