Skip to content

Commit 0efb1ae

Browse files
committed
Remove deprecated option ssl imports
1 parent 599cf75 commit 0efb1ae

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

cassandra/connection.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@
2626
import sys
2727
from threading import Thread, Event, RLock, Condition
2828
import time
29-
30-
try:
31-
import ssl
32-
except ImportError:
33-
ssl = None # NOQA
29+
import ssl
3430

3531
if 'gevent.monkey' in sys.modules:
3632
from gevent.queue import Queue, Empty

cassandra/io/asyncorereactor.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import time
2323
import weakref
2424
import sys
25+
import ssl
2526

2627
from six.moves import range
2728

@@ -32,11 +33,6 @@
3233

3334
import asyncore
3435

35-
try:
36-
import ssl
37-
except ImportError:
38-
ssl = None # NOQA
39-
4036
from cassandra.connection import Connection, ConnectionShutdown, NONBLOCKING, Timer, TimerManager
4137

4238
log = logging.getLogger(__name__)
@@ -424,7 +420,7 @@ def handle_read(self):
424420
if len(buf) < self.in_buffer_size:
425421
break
426422
except socket.error as err:
427-
if ssl and isinstance(err, ssl.SSLError):
423+
if isinstance(err, ssl.SSLError):
428424
if err.args[0] in (ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE):
429425
if not self._iobuf.tell():
430426
return

cassandra/io/libevreactor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def handle_read(self, watcher, revents, errno=None):
343343
if len(buf) < self.in_buffer_size:
344344
break
345345
except socket.error as err:
346-
if ssl and isinstance(err, ssl.SSLError):
346+
if isinstance(err, ssl.SSLError):
347347
if err.args[0] in (ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE):
348348
if not self._iobuf.tell():
349349
return

0 commit comments

Comments
 (0)