2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Fix confluentdbgcli.py for python3

This commit is contained in:
Jarrod Johnson 2022-09-02 15:11:30 -04:00
parent 6c1f87aeb7
commit 7980534bad

View File

@ -1,4 +1,4 @@
#!/usr/bin/python2
#!/usr/bin/python3
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
@ -52,7 +52,7 @@ class GetInput(threading.Thread):
global pendingoutput
while True:
try:
pendingoutput = raw_input('')
pendingoutput = input('')
except EOFError:
pendingoutput = False
break
@ -66,12 +66,12 @@ while True:
except select.error:
continue
if conn in r:
sys.stdout.write(conn.recv(1))
sys.stdout.write(conn.recv(1).decode('utf8'))
if pendingoutput is not None:
if pendingoutput is False:
conn.shutdown(socket.SHUT_WR)
sys.exit(1)
else:
conn.sendall(pendingoutput + '\n')
conn.sendall((pendingoutput + '\n').encode('utf8'))
pendingoutput = None
sys.stdout.flush()