Use unhexlify

* for decoding, use unhexlify
This commit is contained in:
Christoph Heuel 2015-06-15 23:08:49 +02:00
parent 0ef2951c7e
commit 6734864a5b
1 changed files with 2 additions and 2 deletions

View File

@ -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