1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,6 @@
url='https://github.com/invisibleroads/socketIO-client',
install_requires=[
'requests>=2.7.0',
- 'six',
'websocket-client',
],
tests_require=[
--- a/socketIO_client/parsers.py
+++ b/socketIO_client/parsers.py
@@ -1,7 +1,6 @@
import json
-import six
from collections import namedtuple
-from six.moves.urllib.parse import urlparse as parse_url
+from urllib.parse import urlparse as parse_url
from .symmetries import decode_string, encode_string, get_byte, get_character
@@ -83,7 +82,7 @@
args = json.loads(data)
except ValueError:
args = []
- if isinstance(args, six.string_types):
+ if isinstance(args, str):
args = [args]
return SocketIOData(path=path, ack_id=ack_id, args=args)
--- a/socketIO_client/symmetries.py
+++ b/socketIO_client/symmetries.py
@@ -9,7 +9,8 @@
pass
-from six import indexbytes
+import operator
+indexbytes = operator.getitem
try:
--- a/socketIO_client/transports.py
+++ b/socketIO_client/transports.py
@@ -1,10 +1,9 @@
import requests
-import six
import ssl
import threading
import time
-from six.moves.urllib.parse import urlencode as format_query
-from six.moves.urllib.parse import urlparse as parse_url
+from urllib.parse import urlencode as format_query
+from urllib.parse import urlparse as parse_url
from socket import error as SocketError
try:
from websocket import (
@@ -130,7 +129,7 @@
proxy_url_pack.username, proxy_url_pack.password)
if http_session.verify:
if http_session.cert: # Specify certificate path on disk
- if isinstance(http_session.cert, six.string_types):
+ if isinstance(http_session.cert, str):
kw['ca_certs'] = http_session.cert
else:
kw['ca_certs'] = http_session.cert[0]
@@ -152,7 +151,7 @@
raise ConnectionError('recv disconnected (%s)' % e)
except SocketError as e:
raise ConnectionError('recv disconnected (%s)' % e)
- if not isinstance(packet_text, six.binary_type):
+ if not isinstance(packet_text, bytes):
packet_text = packet_text.encode('utf-8')
engineIO_packet_type, engineIO_packet_data = parse_packet_text(
packet_text)
|