Catch more potential errors when setting up curses.

This commit is contained in:
Felix Fontein 2021-02-12 21:14:29 +01:00 committed by Matt Clay
parent f0ec10dbc3
commit ff0edca8cc
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "pause - catch additional error on setting up curses (https://github.com/ansible/ansible/pull/73588)."

View file

@ -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