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:
|
try:
|
||||||
import curses
|
import curses
|
||||||
|
import io
|
||||||
|
|
||||||
# Nest the try except since curses.error is not available if curses did not import
|
# Nest the try except since curses.error is not available if curses did not import
|
||||||
try:
|
try:
|
||||||
curses.setupterm()
|
curses.setupterm()
|
||||||
HAS_CURSES = True
|
HAS_CURSES = True
|
||||||
except (curses.error, TypeError):
|
except (curses.error, TypeError, io.UnsupportedOperation):
|
||||||
HAS_CURSES = False
|
HAS_CURSES = False
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_CURSES = False
|
HAS_CURSES = False
|
||||||
|
|
Loading…
Reference in a new issue