Merge "Remove references to 'sys.version_info'"

This commit is contained in:
Zuul 2021-06-01 12:06:42 +00:00 committed by Gerrit Code Review
commit 091fd6510a
2 changed files with 3 additions and 6 deletions

View File

@ -197,12 +197,11 @@ class SignalHandler(metaclass=Singleton):
def __setup_signal_interruption(self):
"""Set up to do the Right Thing with signals during poll() and sleep().
For Python 3.5 and later, deal with the changes in PEP 475 that prevent
a signal from interrupting eventlet's call to poll() or sleep().
Deal with the changes introduced in PEP 475 that prevent a signal from
interrupting eventlet's call to poll() or sleep().
"""
select_module = eventlet.patcher.original('select')
self.__force_interrupt_on_signal = (sys.version_info >= (3, 5) and
hasattr(select_module, 'poll'))
self.__force_interrupt_on_signal = hasattr(select_module, 'poll')
if self.__force_interrupt_on_signal:
try:

View File

@ -476,7 +476,6 @@ class ProcessLauncherTest(base.ServiceBaseTestCase):
m.assert_called_once_with(signal.SIGTERM, 'test')
signal_handler.clear()
@mock.patch('sys.version_info', (3, 5))
def test_setup_signal_interruption_no_select_poll(self):
# NOTE(claudiub): SignalHandler is a singleton, which means that it
# might already be initialized. We need to clear to clear the cache
@ -490,7 +489,6 @@ class ProcessLauncherTest(base.ServiceBaseTestCase):
self.assertFalse(
signal_handler._SignalHandler__force_interrupt_on_signal)
@mock.patch('sys.version_info', (3, 5))
def test_setup_signal_interruption_select_poll(self):
# NOTE(claudiub): SignalHandler is a singleton, which means that it
# might already be initialized. We need to clear to clear the cache