Remove references to 'sys.version_info'

We support Python 3.6 as a minimum now, making these checks no-ops.

Change-Id: I2cd6d5272eeacbda91e389efb1cfaaadf376d767
This commit is contained in:
Jorhson Deng 2021-04-27 01:46:46 +00:00 committed by dengzhaosen
parent 219ab13705
commit 355e0bd79b
1 changed files with 1 additions and 12 deletions

View File

@ -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: