commit
1eb8faa247
1 changed files with 4 additions and 1 deletions
|
|
@ -68,7 +68,10 @@ class _AbstractTransport(object):
|
|||
|
||||
def send_packet(self, code, path='', data='', callback=None):
|
||||
packet_id = self.set_ack_callback(callback) if callback else ''
|
||||
packet_parts = str(code), packet_id, path, unicode(data).encode('utf-8')
|
||||
try:
|
||||
packet_parts = str(code), packet_id, path, unicode(data).encode('utf-8')
|
||||
except NameError: # fix for p3k
|
||||
packet_parts = str(code), packet_id, path, data
|
||||
packet_text = ':'.join(packet_parts)
|
||||
self.send(packet_text)
|
||||
self._log(logging.DEBUG, '[packet sent] %s', packet_text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue