Fix byte format() on Python 3.
This commit is contained in:
parent
c3e3ec5808
commit
ddc93d7369
|
@ -211,10 +211,9 @@ class MagicEncode(object):
|
||||||
# is different, emit a change command.
|
# is different, emit a change command.
|
||||||
if encoding != self.encoding:
|
if encoding != self.encoding:
|
||||||
self.encoding = encoding
|
self.encoding = encoding
|
||||||
self.driver._raw(b'{}{}'.format(
|
self.driver._raw(
|
||||||
CODEPAGE_CHANGE,
|
CODEPAGE_CHANGE +
|
||||||
six.int2byte(self.encoder.get_sequence(encoding))
|
six.int2byte(self.encoder.get_sequence(encoding)))
|
||||||
))
|
|
||||||
|
|
||||||
if text:
|
if text:
|
||||||
self.driver._raw(CodePages.encode(text, encoding, errors="replace"))
|
self.driver._raw(CodePages.encode(text, encoding, errors="replace"))
|
||||||
|
|
Loading…
Reference in New Issue