From ff0edca8cc81a4a28c453c79a332b0be82c72f4a Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 12 Feb 2021 21:14:29 +0100 Subject: [PATCH] Catch more potential errors when setting up curses. --- changelogs/fragments/pause-import.yml | 2 ++ lib/ansible/plugins/action/pause.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/pause-import.yml diff --git a/changelogs/fragments/pause-import.yml b/changelogs/fragments/pause-import.yml new file mode 100644 index 00000000000..c6b73f91670 --- /dev/null +++ b/changelogs/fragments/pause-import.yml @@ -0,0 +1,2 @@ +bugfixes: +- "pause - catch additional error on setting up curses (https://github.com/ansible/ansible/pull/73588)." diff --git a/lib/ansible/plugins/action/pause.py b/lib/ansible/plugins/action/pause.py index 88babe61b33..cb367091682 100644 --- a/lib/ansible/plugins/action/pause.py +++ b/lib/ansible/plugins/action/pause.py @@ -40,12 +40,13 @@ display = Display() try: import curses + import io # Nest the try except since curses.error is not available if curses did not import try: curses.setupterm() HAS_CURSES = True - except (curses.error, TypeError): + except (curses.error, TypeError, io.UnsupportedOperation): HAS_CURSES = False except ImportError: HAS_CURSES = False