Skip to content

Commit

Permalink
- Change gevent import to remove deprecation warning when newer geven…
Browse files Browse the repository at this point in the history
…t is

  used. PR python-zk#191, patch by Hiroaki Kawai.
  • Loading branch information
bbangert committed Apr 22, 2014
1 parent d777b68 commit 660a8ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Features
Bug Handling
************

- Change gevent import to remove deprecation warning when newer gevent is
used. PR #191, patch by Hiroaki Kawai.
- Lock recipe was failing to use the client's sleep_func causing issues with
gevent. Issue #150.
- Calling a DataWatch or ChildrenWatch instance twice (decorator) now throws
Expand Down
9 changes: 6 additions & 3 deletions kazoo/handlers/gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import logging

import gevent
import gevent.coros
import gevent.event
import gevent.queue
import gevent.select
Expand All @@ -14,6 +13,10 @@
from gevent.queue import Empty
from gevent.queue import Queue
from gevent import socket
try:
from gevent.lock import Semaphore, RLock
except ImportError:
from gevent.coros import Semaphore, RLock

from kazoo.handlers.utils import create_tcp_socket, create_tcp_connection

Expand Down Expand Up @@ -54,7 +57,7 @@ def __init__(self):
self.callback_queue = Queue()
self._running = False
self._async = None
self._state_change = gevent.coros.Semaphore()
self._state_change = Semaphore()
self._workers = []

class timeout_exception(gevent.event.Timeout):
Expand Down Expand Up @@ -131,7 +134,7 @@ def lock_object(self):

def rlock_object(self):
"""Create an appropriate RLock object"""
return gevent.coros.RLock()
return RLock()

def async_result(self):
"""Create a :class:`AsyncResult` instance
Expand Down

0 comments on commit 660a8ba

Please sign in to comment.