Kaydet (Commit) 54b40ee9 authored tarafından Victor Stinner's avatar Victor Stinner

Fix my last commit (r81471) about codecs

Rememder: don't touch the code just before a commit
üst 7df55dad
...@@ -67,11 +67,11 @@ class StreamWriter(codecs.StreamWriter): ...@@ -67,11 +67,11 @@ class StreamWriter(codecs.StreamWriter):
def encode(self, input, errors='strict'): def encode(self, input, errors='strict'):
if self.encoder is None: if self.encoder is None:
result = codecs.utf_16encoder(input, errors) result = codecs.utf_16_encode(input, errors)
if sys.byteorder == 'little': if sys.byteorder == 'little':
self.encoder = codecs.utf_16_leencoder self.encoder = codecs.utf_16_le_encode
else: else:
self.encoder = codecs.utf_16_beencoder self.encoder = codecs.utf_16_be_encode
return result return result
else: else:
return self.encoder(input, errors) return self.encoder(input, errors)
......
...@@ -107,11 +107,11 @@ class StreamWriter(codecs.StreamWriter): ...@@ -107,11 +107,11 @@ class StreamWriter(codecs.StreamWriter):
def encode(self, input, errors='strict'): def encode(self, input, errors='strict'):
if self.encoder is None: if self.encoder is None:
result = codecs.utf_32encoder(input, errors) result = codecs.utf_32_encode(input, errors)
if sys.byteorder == 'little': if sys.byteorder == 'little':
self.encoder = codecs.utf_32_leencoder self.encoder = codecs.utf_32_le_encode
else: else:
self.encoder = codecs.utf_32_beencoder self.encoder = codecs.utf_32_be_encode
return result return result
else: else:
return self.encoder(input, errors) return self.encoder(input, errors)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment