Skip to content

Commit

Permalink
PYTHON-1364 Fix ssl.wrap_socket errors (from eventlet) for Python 3.12 (
Browse files Browse the repository at this point in the history
  • Loading branch information
absurdfarce authored and dkropachev committed Jan 26, 2025
1 parent dccfe90 commit b4b2272
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cassandra/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ def _is_eventlet_monkey_patched():
def _is_gevent_monkey_patched():
if 'gevent.monkey' not in sys.modules:
return False
import gevent.socket
return socket.socket is gevent.socket.socket
try:
import eventlet.patcher
return eventlet.patcher.is_monkey_patched('socket')
# Another case related to PYTHON-1364
except AttributeError:
return False


# default to gevent when we are monkey patched with gevent, eventlet when
Expand Down

0 comments on commit b4b2272

Please sign in to comment.