tests: data/fakessh.py 3.x fixes.

This commit is contained in:
David Wilson 2018-09-10 01:23:29 +01:00
parent b3be182795
commit 7cd4d0828d
1 changed files with 6 additions and 6 deletions

View File

@ -17,22 +17,22 @@ HOST_KEY_STRICT_MSG = """Host key verification failed.\n"""
def tty(msg): def tty(msg):
fp = open('/dev/tty', 'w', 0) fp = open('/dev/tty', 'wb', 0)
fp.write(msg) fp.write(msg.encode())
fp.close() fp.close()
def stderr(msg): def stderr(msg):
fp = open('/dev/stderr', 'w', 0) fp = open('/dev/stderr', 'wb', 0)
fp.write(msg) fp.write(msg.encode())
fp.close() fp.close()
def confirm(msg): def confirm(msg):
tty(msg) tty(msg)
fp = open('/dev/tty', 'r', 0) fp = open('/dev/tty', 'rb', 0)
try: try:
return fp.readline() return fp.readline().decode()
finally: finally:
fp.close() fp.close()