Commits

Denis Bilenko committed 9eb6779

raise TypeError instead of Exception in _encode_text()

  • Participants
  • Parent commits bf12557
  • Branches stable

Comments (0)

Files changed (1)

geventwebsocket/websocket.py

         elif isinstance(s, str):
             return unicode(s).encode('utf-8')
         else:
-            raise Exception('Invalid encoding')
+            raise TypeError('Invalid encoding')
 
     def _is_valid_opcode(self, opcode):
         return opcode in (self.OPCODE_CONTINUATION, self.OPCODE_TEXT, self.OPCODE_BINARY,