Fix my last commit (r81471) about codecs

Rememder: don't touch the code just before a commit
This commit is contained in:
Victor Stinner 2010-05-22 13:44:25 +00:00
parent 7df55dad3b
commit 54b40ee929
2 changed files with 6 additions and 6 deletions

View File

@ -67,11 +67,11 @@ class StreamWriter(codecs.StreamWriter):
def encode(self, input, errors='strict'):
if self.encoder is None:
result = codecs.utf_16encoder(input, errors)
result = codecs.utf_16_encode(input, errors)
if sys.byteorder == 'little':
self.encoder = codecs.utf_16_leencoder
self.encoder = codecs.utf_16_le_encode
else:
self.encoder = codecs.utf_16_beencoder
self.encoder = codecs.utf_16_be_encode
return result
else:
return self.encoder(input, errors)

View File

@ -107,11 +107,11 @@ class StreamWriter(codecs.StreamWriter):
def encode(self, input, errors='strict'):
if self.encoder is None:
result = codecs.utf_32encoder(input, errors)
result = codecs.utf_32_encode(input, errors)
if sys.byteorder == 'little':
self.encoder = codecs.utf_32_leencoder
self.encoder = codecs.utf_32_le_encode
else:
self.encoder = codecs.utf_32_beencoder
self.encoder = codecs.utf_32_be_encode
return result
else:
return self.encoder(input, errors)