Commits

Denis Bilenko committed 34b6d01

Fix send_frame() to accept message of type other than string

  • Participants
  • Parent commits 7c2a166
  • Branches stable

Comments (0)

Files changed (1)

File geventwebsocket/websocket.py

         else:
             raise FrameTooLargeException()
 
-        with self._writelock:
-            self._write(header + message)
+        try:
+            combined = header + message
+        except TypeError:
+            with self._writelock:
+                self._write(header)
+                self._write(message)
+        else:
+            with self._writelock:
+                self._write(combined)
 
     def send(self, message, binary=None):
         """Send a frame over the websocket with message as its payload"""