mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
c737e93a34
commit
e5dbf63b65
1 changed files with 5 additions and 5 deletions
|
@ -144,17 +144,17 @@ class ActionModule(ActionBase):
|
||||||
|
|
||||||
# save the attributes on the existing (duped) stdin so
|
# save the attributes on the existing (duped) stdin so
|
||||||
# that we can restore them later after we set raw mode
|
# that we can restore them later after we set raw mode
|
||||||
if PY3:
|
|
||||||
stdin = self._connection._new_stdin.buffer
|
|
||||||
else:
|
|
||||||
stdin = self._connection._new_stdin
|
|
||||||
fd = None
|
fd = None
|
||||||
try:
|
try:
|
||||||
|
if PY3:
|
||||||
|
stdin = self._connection._new_stdin.buffer
|
||||||
|
else:
|
||||||
|
stdin = self._connection._new_stdin
|
||||||
fd = stdin.fileno()
|
fd = stdin.fileno()
|
||||||
except (ValueError, AttributeError):
|
except (ValueError, AttributeError):
|
||||||
# ValueError: someone is using a closed file descriptor as stdin
|
# ValueError: someone is using a closed file descriptor as stdin
|
||||||
# AttributeError: someone is using a null file descriptor as stdin on windoez
|
# AttributeError: someone is using a null file descriptor as stdin on windoez
|
||||||
pass
|
stdin = None
|
||||||
if fd is not None:
|
if fd is not None:
|
||||||
if isatty(fd):
|
if isatty(fd):
|
||||||
old_settings = termios.tcgetattr(fd)
|
old_settings = termios.tcgetattr(fd)
|
||||||
|
|
Loading…
Reference in a new issue