From 6734864a5b25f34678c14ad80122d99ab9ccadc8 Mon Sep 17 00:00:00 2001 From: Christoph Heuel Date: Mon, 15 Jun 2015 23:08:49 +0200 Subject: [PATCH] Use unhexlify * for decoding, use unhexlify --- escpos/escpos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/escpos/escpos.py b/escpos/escpos.py index 9d37709..30fc126 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -46,7 +46,7 @@ class Escpos: self._raw(S_RASTER_N) buffer = "%02X%02X%02X%02X" % (((size[0]/size[1])/8), 0, size[1], 0) - self._raw(buffer.decode('hex')) + self._raw(binascii.unhexlify(buffer)) buffer = "" while i < len(line): @@ -55,7 +55,7 @@ class Escpos: i += 8 cont += 1 if cont % 4 == 0: - self._raw(buffer.decode("hex")) + self._raw(binascii.unhexlify(buffer)) buffer = "" cont = 0