From c74b14cc8d247109c8a877e4c9b948a9d9143d61 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 24 Sep 2014 12:35:38 +0200 Subject: Fixed ICE-5535, WSS hang and other minor issues - ICE-5535: added support for parsing TCP/SSL/WS/WSS endpoints even if the transport isn't supported - WSS implementation could hang under Java/C# if the SSL transport read too much data - The opaque endpoint un-marshalling code in Java/C# could raise an EncapsulationException where it should have raised an UnarmshalOutOfBoundsException if the marshalled endpoint was invalid. - Cleaned up JavaScript run methods for tests - Few other minor fixes --- scripts/Expect.py | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'scripts/Expect.py') diff --git a/scripts/Expect.py b/scripts/Expect.py index 5d231ad3e9f..9b579aba63d 100755 --- a/scripts/Expect.py +++ b/scripts/Expect.py @@ -452,29 +452,33 @@ class Expect (object): The exit status is returned. A negative exit status means the application was killed by a signal. """ - if self.p is not None: + if self.p is None: + return self.exitstatus - # Unfortunately, with the subprocess module there is no - # better method of doing a timed wait. - if timeout is not None: - end = time.time() + timeout - while time.time() < end and self.p.poll() is None: - time.sleep(0.1) - if self.p.poll() is None: - raise TIMEOUT ('timedwait exceeded timeout') - - self.exitstatus = self.p.wait() - - # A Windows application killed with CTRL_BREAK. Fudge the exit status. - if win32 and self.exitstatus != 0 and self.killed is not None: - self.exitstatus = -self.killed - self.p = None - self.r.join() - # Simulate a match on EOF - self.buf = self.r.getbuf() - self.before = self.buf - self.after = "" - self.r = None + # Unfortunately, with the subprocess module there is no + # better method of doing a timed wait. + if timeout is not None: + end = time.time() + timeout + while time.time() < end and self.p and self.p.poll() is None: + time.sleep(0.1) + if self.p and self.p.poll() is None: + raise TIMEOUT ('timedwait exceeded timeout') + + if self.p is None: + return self.exitstatus + + self.exitstatus = self.p.wait() + + # A Windows application killed with CTRL_BREAK. Fudge the exit status. + if win32 and self.exitstatus != 0 and self.killed is not None: + self.exitstatus = -self.killed + self.p = None + self.r.join() + # Simulate a match on EOF + self.buf = self.r.getbuf() + self.before = self.buf + self.after = "" + self.r = None return self.exitstatus def terminate(self): -- cgit v1.2.3