mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-28 03:48:35 +00:00
Induce python2 to unicode
eventlet will treat str as binary, correct by forcing unicode. For python3, it is a no-op, but python2 needs it to pass the 'text_type' check in eventlet.
This commit is contained in:
parent
d82690f0d9
commit
479ddd582e
@ -656,6 +656,7 @@ def become_leader(connection):
|
||||
reassimilate = eventlet.spawn(reassimilate_missing)
|
||||
|
||||
def reassimilate_missing():
|
||||
eventlet.sleep(30)
|
||||
while cfm.cfgstreams and _assimilate_missing():
|
||||
eventlet.sleep(30)
|
||||
|
||||
|
@ -420,11 +420,11 @@ def wsock_handler(ws):
|
||||
def datacallback(data):
|
||||
if isinstance(data, dict):
|
||||
data = json.dumps(data)
|
||||
ws.send('!' + data)
|
||||
ws.send(u'!' + data)
|
||||
elif not isinstance(data, str):
|
||||
ws.send(' ' + data.decode('utf8'))
|
||||
ws.send(u' ' + data.decode('utf8'))
|
||||
else:
|
||||
ws.send(' ' + data)
|
||||
ws.send(u' ' + data)
|
||||
try:
|
||||
if shellsession:
|
||||
consession = shellserver.ShellSession(
|
||||
@ -454,7 +454,7 @@ def wsock_handler(ws):
|
||||
consession.resize(
|
||||
width=cmd['width'], height=cmd['height'])
|
||||
elif clientmsg[0] == '?':
|
||||
ws.send('?')
|
||||
ws.send(u'?')
|
||||
clientmsg = ws.wait()
|
||||
finally:
|
||||
consession.destroy()
|
||||
|
Loading…
x
Reference in New Issue
Block a user