tiny refactoring.

This commit is contained in:
Hiroki Ohtani
2014-12-22 10:14:33 +09:00
parent a58b94d826
commit fc9325da88

View File

@@ -638,12 +638,13 @@ class WebSocket(object):
while True: while True:
line = self._recv_line() line = self._recv_line()
line = line.decode('utf-8') line = line.decode('utf-8').strip()
if line == "\r\n" or line == "\n": if not line:
break break
line = line.strip()
if traceEnabled: if traceEnabled:
logger.debug(line) logger.debug(line)
if not status: if not status:
status_info = line.split(" ", 2) status_info = line.split(" ", 2)
status = int(status_info[1]) status = int(status_info[1])