Browse files

remove six from the requirements

We were only using six for test callables.
  • Loading branch information...
1 parent 58bed8b commit 3950d341db0cbf79cf94ff6718444c6679f3b740 @benoitc committed Nov 7, 2012
Showing with 20 additions and 11 deletions.
  1. +0 −1 requirements.txt
  2. +0 −1 requirements_dev.txt
  3. +1 −2 setup.py
  4. +5 −3 uzmq/poll.py
  5. +5 −4 uzmq/sock.py
  6. +9 −0 uzmq/util.py
View
1 requirements.txt
@@ -1,3 +1,2 @@
pyuv>=0.8.3
pyzmq
-six
View
1 requirements_dev.txt
@@ -1,4 +1,3 @@
pyuv>=0.8.3
pyzmq
-six
pytest
View
3 setup.py
@@ -57,7 +57,6 @@
packages=find_packages(),
install_requires = [
'pyuv>=0.8.3',
- 'pyzmq',
- 'six'
+ 'pyzmq'
],
data_files = DATA_FILES)
View
8 uzmq/poll.py
@@ -7,9 +7,11 @@
"""
import pyuv
-import six
import zmq
+
+from . import util
+
class ZMQPoll(object):
"""\
:param loop: loop object where this handle runs (accessible
@@ -71,7 +73,7 @@ def start(self, events, callback):
Start or update the event mask of the ``ZMQPoll`` handle.
"""
- if not six.callable(callback):
+ if not util.is_callable(callback):
raise TypeError("a callable is required")
self._callback = callback
@@ -90,7 +92,7 @@ def close(self, callback=None):
operations can be performed on it.
"""
self._poller.close()
- if six.callable(callback):
+ if util.is_callable(callback):
callback(self)
def _poll(self, handle, evs, errno):
View
9 uzmq/sock.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -
#
-# This file is part of zmq. See the NOTICE for more information.
+# This file is part of uzmq. See the NOTICE for more information.
from collections import deque
import logging
@@ -10,6 +10,7 @@
import zmq
from .poll import ZMQPoll
+from . import util
class ZMQ(object):
"""\
@@ -51,7 +52,7 @@ def start_read(self, callback, copy=True, track=False):
"""
:param callback: callable
callback must take exactly one argument, which will be a
- list, as returned by socket.recv_multipart()
+ /iist, as returned by socket.recv_multipart()
if callback is None, recv callbacks are disabled.
:param copy: bool
copy is passed directly to recv, so if copy is False,
@@ -65,7 +66,7 @@ def start_read(self, callback, copy=True, track=False):
Start reading for incoming messages from the remote endpoint.
"""
- if not six.callable(callback):
+ if not util.is_callable(callback):
raise TypeError("a callable is required")
self._read_cb = callback
@@ -162,7 +163,7 @@ def _send(self):
logging.error("SEND Error: %s", e)
status = e
- if six.callable(cb):
+ if util.is_callable(cb):
cb(self, msg, status)
def _on_events(self, handle, events, err):
View
9 uzmq/util.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -
+#
+# This file is part of zmq. See the NOTICE for more information.
+
+
+try:
+ is_callable = callable
+except NameError:
+ is_callable = lambda obj: hasattr(obj, '__call__')

0 comments on commit 3950d34

Please sign in to comment.