basic: Handle exception in default selector (#72101)
In Python 2.7, default selector raises IOError instead of OSError. Fix handles this exception. Fixes: #71704 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
ebc91a9b93
commit
9ffa84cc1c
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/71704_selector.yml
Normal file
2
changelogs/fragments/71704_selector.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- basic - handle exceptions for default selectors in Python 2.7 (https://github.com/ansible/ansible/issues/71704).
|
|
@ -2712,7 +2712,7 @@ class AnsibleModule(object):
|
|||
stderr = b''
|
||||
try:
|
||||
selector = selectors.DefaultSelector()
|
||||
except OSError:
|
||||
except (IOError, OSError):
|
||||
# Failed to detect default selector for the given platform
|
||||
# Select PollSelector which is supported by major platforms
|
||||
selector = selectors.PollSelector()
|
||||
|
|
Loading…
Reference in a new issue