Fix Python 3.8 file operations

Under Python 3.8 we can not wrap a File in a Sock.

Note this currently requires Python >= 3.5
This commit is contained in:
Brian May
2020-05-15 07:55:38 +10:00
parent 4b320180c4
commit 6c21addde9
3 changed files with 16 additions and 19 deletions

View File

@ -461,7 +461,7 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
raise Fatal("failed to establish ssh session (1)")
else:
raise
mux = Mux(serversock, serversock)
mux = Mux(serversock.makefile("rb"), serversock.makefile("wb"))
handlers.append(mux)
expected = b'SSHUTTLE0001'