Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenStack
oslo
python-oslo.service
Commits
091fd651
Commit
091fd651
authored
Jun 01, 2021
by
Zuul
Committed by
Gerrit Code Review
Jun 01, 2021
Browse files
Merge "Remove references to 'sys.version_info'"
parents
19f369a6
aea7627e
Changes
2
Hide whitespace changes
Inline
Side-by-side
oslo_service/service.py
View file @
091fd651
...
...
@@ -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, d
eal with the changes in PEP 475 that prevent
a signal from
interrupting eventlet's call to poll() or sleep().
D
eal 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
:
...
...
oslo_service/tests/test_service.py
View file @
091fd651
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment