Set timeouts properly
authorTimo Ewalds <tewalds@google.com>
Fri, 16 Aug 2013 22:01:14 +0000 (18:01 -0400)
committerTimo Ewalds <tewalds@google.com>
Fri, 16 Aug 2013 22:01:14 +0000 (18:01 -0400)
tweepy/streaming.py

index f6d37f450111166bfb67d22b93177c2894275ce9..78888c2d6dedb429beee802afdcca8d1c559b01a 100644 (file)
@@ -108,12 +108,11 @@ class Stream(object):
                 break
             try:
                 if self.scheme == "http":
-                    conn = httplib.HTTPConnection(self.host)
+                    conn = httplib.HTTPConnection(self.host, timeout=self.timeout)
                 else:
-                    conn = httplib.HTTPSConnection(self.host)
+                    conn = httplib.HTTPSConnection(self.host, timeout=self.timeout)
                 self.auth.apply_auth(url, 'POST', self.headers, self.parameters)
                 conn.connect()
-                conn.sock.settimeout(self.timeout)
                 conn.request('POST', self.url, self.body, headers=self.headers)
                 resp = conn.getresponse()
                 if resp.status != 200: