Skip to content

Commit

Permalink
cassandra/cluster.py: make asyncio default if asyncore not available
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
fruch committed Nov 9, 2023
1 parent 7690122 commit 926ae2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cassandra/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def _is_gevent_monkey_patched():
try:
from cassandra.io.libevreactor import LibevConnection as DefaultConnection # NOQA
except ImportError:
from cassandra.io.asyncorereactor import AsyncoreConnection as DefaultConnection # NOQA
try:
from cassandra.io.asyncorereactor import AsyncoreConnection as DefaultConnection # NOQA
except ImportError:
from cassandra.io.asyncioreactor import AsyncioConnection as DefaultConnection # NOQA

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

0 comments on commit 926ae2d

Please sign in to comment.