Summary: TSocket shouldn't let you set the timeout before it's got a valid handle
authorJames Wang <jwang@apache.org>
Tue, 24 Jul 2007 23:59:51 +0000 (23:59 +0000)
committerJames Wang <jwang@apache.org>
Tue, 24 Jul 2007 23:59:51 +0000 (23:59 +0000)
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

index e6168e2..e8b43be 100644 (file)
@@ -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: