From ddc93d7369d80413d840df6b2683f97b74549728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Elsd=C3=B6rfer?= Date: Tue, 30 Aug 2016 18:06:34 +0200 Subject: [PATCH] Fix byte format() on Python 3. --- src/escpos/magicencode.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/escpos/magicencode.py b/src/escpos/magicencode.py index 23fa9e1..b36b844 100644 --- a/src/escpos/magicencode.py +++ b/src/escpos/magicencode.py @@ -211,10 +211,9 @@ class MagicEncode(object): # is different, emit a change command. if encoding != self.encoding: self.encoding = encoding - self.driver._raw(b'{}{}'.format( - CODEPAGE_CHANGE, - six.int2byte(self.encoder.get_sequence(encoding)) - )) + self.driver._raw( + CODEPAGE_CHANGE + + six.int2byte(self.encoder.get_sequence(encoding))) if text: self.driver._raw(CodePages.encode(text, encoding, errors="replace"))