]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/stream.py
Deal with SSL errno2 in timetout mode
[z_archive/twitter.git] / twitter / stream.py
index 4e25c2a899199f12a2b0dc990d63b39c2ab5e5e6..b173eb31ba8bb8f7aaa945e9852a4be7a58c0115 100644 (file)
@@ -59,7 +59,7 @@ class TwitterJSONIter(object):
                 else:
                     self.buf += sock.recv(1024)
             except SSLError as e:
-                if (not self.block) and (e.errno == 2):
+                if ((not self.block) and (e.errno == 2)) or ((self.timeout) and (e.errno == 2)):
                     # Apparently this means there was nothing in the socket buf
                     pass
                 else: