Skip to content

Commit

Permalink
closed_message -> CLOSED_MESSAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jul 31, 2016
1 parent 4a274e2 commit a78333f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aiohttp/_ws_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def json(self, *, loads=json.loads):
return loads(self.data)


closed_message = Message(WSMsgType.closed, None, None)
CLOSED_MESSAGE = Message(WSMsgType.closed, None, None)


class WebSocketError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions aiohttp/client_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import json

from ._ws_impl import Message, WebSocketError, WSMsgType, closed_message
from ._ws_impl import Message, WebSocketError, WSMsgType, CLOSED_MESSAGE

PY_35 = sys.version_info >= (3, 5)

Expand Down Expand Up @@ -123,7 +123,7 @@ def receive(self):
try:
while True:
if self._closed:
return closed_message
return CLOSED_MESSAGE

try:
msg = yield from self._reader.read()
Expand Down
4 changes: 2 additions & 2 deletions aiohttp/web_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from . import hdrs, Timeout
from .errors import HttpProcessingError, ClientDisconnectedError
from ._ws_impl import (do_handshake, Message, WebSocketError,
WSMsgType, closed_message)
WSMsgType, CLOSED_MESSAGE)
from .web_exceptions import (
HTTPBadRequest, HTTPMethodNotAllowed, HTTPInternalServerError)
from .web_reqrep import StreamResponse
Expand Down Expand Up @@ -220,7 +220,7 @@ def receive(self):
self._conn_lost += 1
if self._conn_lost >= THRESHOLD_CONNLOST_ACCESS:
raise RuntimeError('WebSocket connection is closed.')
return closed_message
return CLOSED_MESSAGE

try:
msg = yield from self._reader.read()
Expand Down

0 comments on commit a78333f

Please sign in to comment.