diff options
Diffstat (limited to 'Lib/encodings/utf_16_le.py')
-rw-r--r-- | Lib/encodings/utf_16_le.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Lib/encodings/utf_16_le.py b/Lib/encodings/utf_16_le.py index 8120d5b..95ca830 100644 --- a/Lib/encodings/utf_16_le.py +++ b/Lib/encodings/utf_16_le.py @@ -10,23 +10,20 @@ import codecs ### Codec APIs -class Codec(codecs.Codec): +encode = codecs.utf_16_le_encode - # Note: Binding these as C functions will result in the class not - # converting them to methods. This is intended. - encode = codecs.utf_16_le_encode - decode = codecs.utf_16_le_decode +def decode(input, errors='strict'): + return codecs.utf_16_le_decode(input, errors, True) -class StreamWriter(Codec,codecs.StreamWriter): - pass +class StreamWriter(codecs.StreamWriter): + encode = codecs.utf_16_le_encode -class StreamReader(Codec,codecs.StreamReader): +class StreamReader(codecs.StreamReader): + decode = codecs.utf_16_le_decode - def readline(self, size=None): - raise NotImplementedError, '.readline() is not implemented for UTF-16-LE' ### encodings module API def getregentry(): - return (Codec.encode,Codec.decode,StreamReader,StreamWriter) + return (encode,decode,StreamReader,StreamWriter) |