From e168d5e12707fa4311b44e38eb769083b4a8c964 Mon Sep 17 00:00:00 2001 From: James Wang Date: Tue, 24 Jul 2007 23:59:51 +0000 Subject: [PATCH] Summary: TSocket shouldn't let you set the timeout before it's got a valid handle Reviewed By: dcorson Test Plan: tested in sandbox git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665172 13f79535-47bb-0310-9956-ffa450edef68 --- lib/py/src/transport/TSocket.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/py/src/transport/TSocket.py b/lib/py/src/transport/TSocket.py index e6168e2da..e8b43bec8 100644 --- a/lib/py/src/transport/TSocket.py +++ b/lib/py/src/transport/TSocket.py @@ -27,6 +27,8 @@ class TSocket(TTransportBase): def setTimeout(self, ms): if (self.handle != None): self.handle.settimeout(ms/1000.00) + else: + raise TTransportException(TTransportException.NOT_OPEN, 'No handle yet in TSocket') def open(self): try: