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>
pull/72138/head
Abhijeet Kasurde 4 years ago committed by GitHub
parent ebc91a9b93
commit 9ffa84cc1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save