Skip to content

Commit f34001b

Browse files
committed
remove references to asyncore per medaminezghal
1 parent 3145c8c commit f34001b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

cassandra/cluster.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ def _try_libev_import():
148148
except DependencyException as e:
149149
return (None, e)
150150

151-
def _try_asyncore_import():
151+
def _try_asyncio_import():
152152
try:
153-
from cassandra.io.asyncorereactor import AsyncoreConnection
154-
return (AsyncoreConnection,None)
153+
from cassandra.io.asyncioreactor import AsyncioConnection
154+
return (AsyncioConnection,None)
155155
except DependencyException as e:
156156
return (None, e)
157157

@@ -167,7 +167,7 @@ def _connection_reduce_fn(val,import_fn):
167167

168168
log = logging.getLogger(__name__)
169169

170-
conn_fns = (_try_gevent_import, _try_eventlet_import, _try_libev_import, _try_asyncore_import)
170+
conn_fns = (_try_gevent_import, _try_eventlet_import, _try_libev_import, _try_asyncio_import)
171171
(conn_class, excs) = reduce(_connection_reduce_fn, conn_fns, (None,[]))
172172
if not conn_class:
173173
raise DependencyException("Unable to load a default connection class", excs)
@@ -875,15 +875,15 @@ def default_retry_policy(self, policy):
875875
This determines what event loop system will be used for managing
876876
I/O with Cassandra. These are the current options:
877877
878-
* :class:`cassandra.io.asyncorereactor.AsyncoreConnection`
878+
* :class:`cassandra.io.asyncioreactor.AsyncioConnection`
879879
* :class:`cassandra.io.libevreactor.LibevConnection`
880880
* :class:`cassandra.io.eventletreactor.EventletConnection` (requires monkey-patching - see doc for details)
881881
* :class:`cassandra.io.geventreactor.GeventConnection` (requires monkey-patching - see doc for details)
882882
* :class:`cassandra.io.twistedreactor.TwistedConnection`
883883
* EXPERIMENTAL: :class:`cassandra.io.asyncioreactor.AsyncioConnection`
884884
885-
By default, ``AsyncoreConnection`` will be used, which uses
886-
the ``asyncore`` module in the Python standard library.
885+
By default, ``AsyncioConnection`` will be used, which uses
886+
the ``asyncio`` module in the Python standard library.
887887
888888
If ``libev`` is installed, ``LibevConnection`` will be used instead.
889889

tests/integration/long/test_ipv6.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ccmlib import common
1717

1818
from cassandra.cluster import NoHostAvailable
19-
from cassandra.io.asyncorereactor import AsyncoreConnection
19+
from cassandra.io.asyncioreactor import AsyncioConnection
2020

2121
from tests import is_monkey_patched
2222
from tests.integration import use_cluster, remove_cluster, TestCluster

tests/unit/io/test_asyncioreactor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
AsyncioConnection, ASYNCIO_AVAILABLE = None, False
22
try:
33
from cassandra.io.asyncioreactor import AsyncioConnection
4-
import asynctest
54
ASYNCIO_AVAILABLE = True
65
except (ImportError, SyntaxError):
76
AsyncioConnection = None
@@ -11,6 +10,7 @@
1110
from tests.unit.io.utils import TimerCallback, TimerTestMixin
1211

1312
from unittest.mock import patch
13+
from unittest.mock import AsyncMock
1414

1515
import unittest
1616
import time
@@ -56,7 +56,7 @@ def setUp(self):
5656
socket_patcher.start()
5757

5858
old_selector = AsyncioConnection._loop._selector
59-
AsyncioConnection._loop._selector = asynctest.TestSelector()
59+
AsyncioConnection._loop._selector = AsyncMock()
6060

6161
def reset_selector():
6262
AsyncioConnection._loop._selector = old_selector

0 commit comments

Comments
 (0)