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") raise WebSocketProtocolException("rsv is not implemented, yet")
if self.opcode not in ABNF.OPCODES: 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: if self.opcode == ABNF.OPCODE_PING and not self.fin:
raise WebSocketProtocolException("Invalid ping frame.") raise WebSocketProtocolException("Invalid ping frame.")

View File

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