Skip to content

Commit abde4ed

Browse files
committed
CASSPYTHON-18: removed obsolete check for python version > 3.7+
1 parent 6fbcacb commit abde4ed

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

cassandra/cluster.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,26 +1424,26 @@ def _create_thread_pool_executor(self, **kwargs):
14241424
:return: A ThreadPoolExecutor instance.
14251425
"""
14261426
tpe_class = ThreadPoolExecutor
1427-
if sys.version_info[0] >= 3 and sys.version_info[1] >= 7:
1428-
try:
1429-
from cassandra.io.eventletreactor import EventletConnection
1430-
is_eventlet = issubclass(self.connection_class, EventletConnection)
1431-
except:
1432-
# Eventlet is not available or can't be detected
1433-
return tpe_class(**kwargs)
14341427

1435-
if is_eventlet:
1436-
try:
1437-
from futurist import GreenThreadPoolExecutor
1438-
tpe_class = GreenThreadPoolExecutor
1439-
except ImportError:
1440-
# futurist is not available
1441-
raise ImportError(
1442-
("Python 3.7+ and Eventlet cause the `concurrent.futures.ThreadPoolExecutor` "
1443-
"to hang indefinitely. If you want to use the Eventlet reactor, you "
1444-
"need to install the `futurist` package to allow the driver to use "
1445-
"the GreenThreadPoolExecutor. See https://github.com/eventlet/eventlet/issues/508 "
1446-
"for more details."))
1428+
try:
1429+
from cassandra.io.eventletreactor import EventletConnection
1430+
is_eventlet = issubclass(self.connection_class, EventletConnection)
1431+
except ImportError:
1432+
# Eventlet is not available or can't be detected
1433+
return tpe_class(**kwargs)
1434+
1435+
if is_eventlet:
1436+
try:
1437+
from futurist import GreenThreadPoolExecutor
1438+
tpe_class = GreenThreadPoolExecutor
1439+
except ImportError:
1440+
# futurist is not available
1441+
raise ImportError(
1442+
("Python 3.7+ and Eventlet cause the `concurrent.futures.ThreadPoolExecutor` "
1443+
"to hang indefinitely. If you want to use the Eventlet reactor, you "
1444+
"need to install the `futurist` package to allow the driver to use "
1445+
"the GreenThreadPoolExecutor. See https://github.com/eventlet/eventlet/issues/508 "
1446+
"for more details."))
14471447

14481448
return tpe_class(**kwargs)
14491449

0 commit comments

Comments
 (0)