File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 3434except NameError :
3535 integer = int
3636 string = str
37+
38+ def hex2 (x ):
39+ if x < 0x10 :
40+ return "0" + hex (x )[2 :].upper ()
41+ else :
42+ return hex (x )[2 :].upper ()
43+
3744else :
3845 integer = (int , long )
3946 string = (str , unicode )
4047
48+ def hex2 (x ):
49+ x = ord (x )
50+ if x < 0x10 :
51+ return "0" + hex (x )[2 :].upper ()
52+ else :
53+ return hex (x )[2 :].upper ()
54+
4155
4256try :
4357 from multiprocessing import Array , Process
Original file line number Diff line number Diff line change 2020
2121from __future__ import division
2222
23- from collections import deque , namedtuple
23+ from collections import deque
2424from io import BytesIO
2525import logging
2626from os import environ
2727from select import select
2828from socket import create_connection , SHUT_RDWR
2929from struct import pack as struct_pack , unpack as struct_unpack , unpack_from as struct_unpack_from
3030
31- from .compat import perf_counter , secure_socket
31+ from .compat import hex2 , secure_socket
3232from .exceptions import ProtocolError
33- from .packstream import Packer , Unpacker , Structure
33+ from .packstream import Packer , Unpacker
3434
3535
3636DEFAULT_PORT = 7687
7070log_error = log .error
7171
7272
73- def hex2 (x ):
74- if x < 0x10 :
75- return "0" + hex (x )[2 :].upper ()
76- else :
77- return hex (x )[2 :].upper ()
78-
79-
8073class ChunkChannel (object ):
8174 """ Reader/writer for chunked data.
8275
You can’t perform that action at this time.
0 commit comments