working with most tests on twisted on py33/34

This commit is contained in:
HawkOwl
2015-05-11 16:39:37 +08:00
parent 97ecc95814
commit 43548b1917
3 changed files with 4 additions and 6 deletions

View File

@@ -1944,8 +1944,7 @@ class WebSocketProtocol(object):
# #
if self.autoPingPending: if self.autoPingPending:
try: try:
p = payload.decode('utf8') if payload == self.autoPingPending:
if p == self.autoPingPending:
if self.debugCodePaths: if self.debugCodePaths:
self.factory._log("Auto ping/pong: received pending pong for auto-ping/pong") self.factory._log("Auto ping/pong: received pending pong for auto-ping/pong")
@@ -2094,9 +2093,9 @@ class WebSocketProtocol(object):
self.autoPingPendingCall = None self.autoPingPendingCall = None
self.autoPingPending = newid(self.autoPingSize) self.autoPingPending = newid(self.autoPingSize).encode('utf8')
self.sendPing(self.autoPingPending.encode('utf8')) self.sendPing(self.autoPingPending)
if self.autoPingTimeout: if self.autoPingTimeout:
if self.debugCodePaths: if self.debugCodePaths:

View File

@@ -252,7 +252,7 @@ if os.environ.get('USE_TWISTED', False):
""" """
auto-ping with correct reply cancels timeout auto-ping with correct reply cancels timeout
""" """
if True: if False:
self.proto.debug = True self.proto.debug = True
self.proto.factory._log = print self.proto.factory._log = print
self.proto.debugCodePaths = True self.proto.debugCodePaths = True

View File

@@ -112,7 +112,6 @@ except ImportError:
def process(self, data): def process(self, data):
dlen = len(data) dlen = len(data)
print(data)
payload = array('B', data) payload = array('B', data)
msk = self.mskarray[self.ptr & 3] msk = self.mskarray[self.ptr & 3]
for k in xrange(dlen): for k in xrange(dlen):