Catch more potential errors when setting up curses.
This commit is contained in:
parent
f0ec10dbc3
commit
ff0edca8cc
2 changed files with 4 additions and 1 deletions
2
changelogs/fragments/pause-import.yml
Normal file
2
changelogs/fragments/pause-import.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- "pause - catch additional error on setting up curses (https://github.com/ansible/ansible/pull/73588)."
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue