diff --git a/oslo_service/service.py b/oslo_service/service.py index c9d6bd0b..fa9c37c2 100644 --- a/oslo_service/service.py +++ b/oslo_service/service.py @@ -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: diff --git a/oslo_service/tests/test_service.py b/oslo_service/tests/test_service.py index 58be122b..fad33e93 100644 --- a/oslo_service/tests/test_service.py +++ b/oslo_service/tests/test_service.py @@ -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