Commits

Jeffrey Gelens committed 67b88da

Fixed #37: WebSocket receive() should never return None

Comments (0)

Files changed (1)

geventwebsocket/websocket.py

         Read and return a message from the stream. If `None` is returned, then
         the socket is considered closed/errored.
         """
+
         if self.closed:
-            return
+            raise WebSocketError("Connection is already closed")
 
         try:
             return self.read_message()
         """
 
         if self.closed:
-            return
+            raise WebSocketError("Connection is already closed")
 
         try:
             message = self._encode_bytes(message)