diff options
| author | liris <liris.pp@gmail.com> | 2014-04-25 12:29:37 +0900 |
|---|---|---|
| committer | liris <liris.pp@gmail.com> | 2014-04-25 12:29:37 +0900 |
| commit | fd95aabd706b93b3b8862a9ae0cc1cc3c656d04c (patch) | |
| tree | e1889ab8f9bf834ce83095961178de37baf02854 /websocket/__init__.py | |
| parent | e197939d13361706a6773c64bdc451cf59e49189 (diff) | |
| download | websocket-client-old_py3.tar.gz | |
- fixed #80v0.13.1-py3py3old_py3
Diffstat (limited to 'websocket/__init__.py')
| -rw-r--r-- | websocket/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/websocket/__init__.py b/websocket/__init__.py index 2607549..66de4dc 100644 --- a/websocket/__init__.py +++ b/websocket/__init__.py @@ -972,7 +972,10 @@ class WebSocketApp(object): elif op_code == ABNF.OPCODE_CONT and self.on_cont_message: self._callback(self.on_cont_message, frame.data, frame.fin) else: - self._callback(self.on_message, frame.data) + data = frame.data + if frame.opcode == ABNF.OPCODE_TEXT: + data = data.decode("utf-8") + self._callback(self.on_message, data) except Exception as e: self._callback(self.on_error, e) finally: |
