Fix Python 3 compatibility issues
This commit is contained in:
parent
8641818cf2
commit
23844f9e76
2 changed files with 28 additions and 11 deletions
13
socketIO_client/compat.py
Normal file
13
socketIO_client/compat.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import six
|
||||
|
||||
|
||||
def get_byte(x, index):
|
||||
return six.indexbytes(x, index)
|
||||
|
||||
|
||||
def get_character(x, index):
|
||||
return chr(six.indexbytes(x, index))
|
||||
|
||||
|
||||
def get_unicode(x):
|
||||
return x.decode('utf-8')
|
||||
Loading…
Add table
Add a link
Reference in a new issue