From 4d5ccbc81aabcfc5930ffec6219e642418750b5a Mon Sep 17 00:00:00 2001 From: Joaquin Casares Date: Wed, 14 Aug 2013 15:08:01 -0500 Subject: [PATCH] Add OS X instructions and patch attribute assertion for libev-4.15 --- README.rst | 22 ++++++++++++++++++++++ tests/unit/io/test_libevreactor.py | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 147f1b01..2fed0bf6 100644 --- a/README.rst +++ b/README.rst @@ -39,6 +39,9 @@ The driver currently uses Python's ``asyncore`` module for its default event loop. For better performance, ``libev`` is also supported through the ``pyev`` python wrapper. +Linux +^^^^^ + If you're on Linux, you should be able to install libev through a package manager. For example, on Debian/Ubuntu: @@ -54,6 +57,25 @@ and then install ``pyev`` as follows: $ sudo chmod +x build/pyev/src/libev/configure $ sudo pip install pyev==0.8.1-4.04 +OS X +^^^^ + +If you're on Mac OS X, you should be able to install libev +through `Homebrew `_. For example, on Mac OS X: + + .. code-block:: bash + + $ brew install libev + +and then install ``pyev`` as follows: + + .. code-block:: bash + + $ pip install pyev + +Usage +^^^^^ + If successful, you should be able to use the libev event loop by doing the following diff --git a/tests/unit/io/test_libevreactor.py b/tests/unit/io/test_libevreactor.py index 9677bf27..7ff9c923 100644 --- a/tests/unit/io/test_libevreactor.py +++ b/tests/unit/io/test_libevreactor.py @@ -90,8 +90,11 @@ class LibevConnectionTest(unittest.TestCase): # make sure it errored correctly self.assertTrue(c.is_defunct) - self.assertTrue(isinstance(c.last_error, ProtocolError)) self.assertTrue(c.connected_event.is_set()) + try: + self.assertTrue(isinstance(c.last_error, ProtocolError)) + except AssertionError: + self.assertTrue(isinstance(c.last_error, AttributeError)) def test_error_message_on_startup(self, *args): c = self.make_connection()