From 355e0bd79bc2757008ac883874c405b5a952bdf8 Mon Sep 17 00:00:00 2001 From: Jorhson Deng Date: Tue, 27 Apr 2021 01:46:46 +0000 Subject: [PATCH] Remove references to 'sys.version_info' We support Python 3.6 as a minimum now, making these checks no-ops. Change-Id: I2cd6d5272eeacbda91e389efb1cfaaadf376d767 --- oslo_messaging/_drivers/pool.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/oslo_messaging/_drivers/pool.py b/oslo_messaging/_drivers/pool.py index 7d29b78d3..8090e8d26 100644 --- a/oslo_messaging/_drivers/pool.py +++ b/oslo_messaging/_drivers/pool.py @@ -14,7 +14,6 @@ import abc import collections -import sys import threading from oslo_log import log as logging @@ -24,16 +23,6 @@ from oslo_messaging._drivers import common LOG = logging.getLogger(__name__) -# TODO(harlowja): remove this when we no longer have to support 2.7 -if sys.version_info[0:2] < (3, 2): - def wait_condition(cond): - # FIXME(markmc): timeout needed to allow keyboard interrupt - # http://bugs.python.org/issue8844 - cond.wait(timeout=1) -else: - def wait_condition(cond): - cond.wait() - class Pool(object, metaclass=abc.ABCMeta): """A thread-safe object pool. @@ -102,7 +91,7 @@ class Pool(object, metaclass=abc.ABCMeta): "current size %s surpasses max " "configured rpc_conn_pool_size %s", self._current_size, self._max_size) - wait_condition(self._cond) + self._cond.wait() # We've grabbed a slot and dropped the lock, now do the creation try: