Permalink
Browse files

make sure we stay compatible with gevent 0.1x

  • Loading branch information...
1 parent c71fa26 commit 7a841fd4becf9f99332b6cae249c3f99ba180fc6 @tarekziade tarekziade committed Dec 14, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 vaurien/proxy.py
View
@@ -100,7 +100,8 @@ def handle(self, client_sock, address):
backend_sock._closed = True
break
- if client_sock.closed:
+ # gevent 1.x introduced 'closed'
+ if hasattr(client_sock, 'closed') and client_sock.closed:
raise ValueError("Client is gone")
greens = [gevent.spawn(self._weirdify,
@@ -137,7 +138,7 @@ def _weirdify(self, client_sock, backend_sock, to_backend,
Depending the configuration, we will chose to either drop packets,
proxy them, wait a long time, etc, as defined in the configuration.
"""
- if client_sock.closed:
+ if hasattr(client_sock, 'closed') and client_sock.closed:
raise ValueError("Client is gone")
if to_backend:

0 comments on commit 7a841fd

Please sign in to comment.