(self)
| 270 | |
| 271 | @asyncio.coroutine |
| 272 | def receive_str(self): |
| 273 | msg = yield from self.receive() |
| 274 | if msg.tp != MsgType.text: |
| 275 | raise TypeError( |
| 276 | "Received message {}:{!r} is not str".format(msg.tp, msg.data)) |
| 277 | return msg.data |
| 278 | |
| 279 | @asyncio.coroutine |
| 280 | def receive_bytes(self): |