summaryrefslogtreecommitdiff
path: root/scripts/Expect.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-09-24 12:35:38 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-09-24 12:35:38 +0200
commitc74b14cc8d247109c8a877e4c9b948a9d9143d61 (patch)
tree87ad62ab9e03e960f6081fd55ec1483774e95a88 /scripts/Expect.py
parentbug fix in IceGrid admin client (diff)
downloadice-c74b14cc8d247109c8a877e4c9b948a9d9143d61.tar.bz2
ice-c74b14cc8d247109c8a877e4c9b948a9d9143d61.tar.xz
ice-c74b14cc8d247109c8a877e4c9b948a9d9143d61.zip
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
Diffstat (limited to 'scripts/Expect.py')
-rwxr-xr-xscripts/Expect.py48
1 files changed, 26 insertions, 22 deletions
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):