mirror of https://github.com/python/cpython
Fix my last commit (r81471) about codecs
Rememder: don't touch the code just before a commit
This commit is contained in:
parent
7df55dad3b
commit
54b40ee929
|
@ -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):
|
||||||
|
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue