use "%r".

This commit is contained in:
Hiroki Ohtani
2015-03-23 08:26:15 +09:00
parent 794e7de720
commit cac1cf234e
2 changed files with 3 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ class ABNF(object):
raise WebSocketProtocolException("rsv is not implemented, yet")
if self.opcode not in ABNF.OPCODES:
raise WebSocketProtocolException("Invalid opcode " + str(self.opcode))
raise WebSocketProtocolException("Invalid opcode %r", self.opcode)
if self.opcode == ABNF.OPCODE_PING and not self.fin:
raise WebSocketProtocolException("Invalid ping frame.")
@@ -284,4 +284,4 @@ class FrameBuffer(object):
return self.mask is None
def recv_mask(self, recv_fn):
self.mask = recv_fn(4) if self.has_mask() else ""
self.mask = recv_fn(4) if self.has_mask() else ""

View File

@@ -154,7 +154,7 @@ def _tunnel(sock, host, port, auth):
if status != 200:
raise WebSocketProxyException(
"failed CONNECT via proxy status: " + str(status))
"failed CONNECT via proxy status: %r" + status)
def read_headers(sock):