Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cassandra/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ def _is_gevent_monkey_patched():
if 'gevent.monkey' not in sys.modules:
return False
try:
import eventlet.patcher
return eventlet.patcher.is_monkey_patched('socket')
# Another case related to PYTHON-1364
except AttributeError:
import gevent.socket
return socket.socket is gevent.socket.socket # Another case related to PYTHON-1364
except (AttributeError, ImportError):
return False

def _try_gevent_import():
Expand Down
3 changes: 2 additions & 1 deletion scripts/run_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ fi

python3 -m venv .test-venv
source .test-venv/bin/activate
pip install -U pip wheel setuptools
pip install --upgrade pip
pip install -U wheel setuptools

# install driver wheel
pip install --ignore-installed -r test-requirements.txt pytest
Expand Down
14 changes: 7 additions & 7 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ def is_monkey_patched():
thread_pool_executor_class = ThreadPoolExecutor

if "gevent" in EVENT_LOOP_MANAGER:
try:
import gevent.monkey
gevent.monkey.patch_all()
from cassandra.io.geventreactor import GeventConnection
connection_class = GeventConnection
except ImportError:
connection_class = None
import gevent.monkey
gevent.monkey.patch_all()
from cassandra.io.geventreactor import GeventConnection
connection_class = GeventConnection
elif "eventlet" in EVENT_LOOP_MANAGER:
from eventlet import monkey_patch
monkey_patch()
Expand All @@ -90,6 +87,9 @@ def is_monkey_patched():
elif "asyncio" in EVENT_LOOP_MANAGER:
from cassandra.io.asyncioreactor import AsyncioConnection
connection_class = AsyncioConnection
elif "libev" in EVENT_LOOP_MANAGER:
from cassandra.io.libevreactor import LibevConnection
connection_class = LibevConnection
else:
log.debug("Using default event loop (libev)")
try:
Expand Down
Loading