+ # this is a non-blocking read (ie, it will return if any data is available)
+ try:
+ self.buf += sock.recv(1024)
+ except SSLError as e:
+ if (not self.block) and (e.errno == 2):
+ # Apparently this means there was nothing in the socket buf
+ pass
+ else:
+ raise
+
+def handle_stream_response(req, uri, arg_data, block):
+ handle = urllib_request.urlopen(req,)
+ return iter(TwitterJSONIter(handle, uri, arg_data, block))