Skip to content

Commit 8bf2590

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 35fd55b commit 8bf2590

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
@@ -143,7 +143,10 @@ def _is_gevent_monkey_patched():
143143
try:
144144
from cassandra.io.libevreactor import LibevConnection as DefaultConnection # NOQA
145145
except ImportError:
146-
from cassandra.io.asyncorereactor import AsyncoreConnection as DefaultConnection # NOQA
146+
try:
147+
from cassandra.io.asyncorereactor import AsyncoreConnection as DefaultConnection # NOQA
148+
except ImportError:
149+
from cassandra.io.asyncioreactor import AsyncioConnection as DefaultConnection # NOQA
147150

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

0 commit comments

Comments
 (0)