Skip to content

Commit 926ae2d

Browse files
committed
cassandra/cluster.py: make asyncio default if asyncore not available
since python 3.12 is deprecating asyncore, we should make asyncio the default fallback event loop when asyncore isn't available asyncio now that it's fixed and we verified it's working (passing the integration suite) in multiple python versions we support (from 3.8 - 3.12)
1 parent 7690122 commit 926ae2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cassandra/cluster.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ def _is_gevent_monkey_patched():
139139
try:
140140
from cassandra.io.libevreactor import LibevConnection as DefaultConnection # NOQA
141141
except ImportError:
142-
from cassandra.io.asyncorereactor import AsyncoreConnection as DefaultConnection # NOQA
142+
try:
143+
from cassandra.io.asyncorereactor import AsyncoreConnection as DefaultConnection # NOQA
144+
except ImportError:
145+
from cassandra.io.asyncioreactor import AsyncioConnection as DefaultConnection # NOQA
143146

144147
# Forces load of utf8 encoding module to avoid deadlock that occurs
145148
# if code that is being imported tries to import the module in a seperate

0 commit comments

Comments
 (0)