From 6b56de67a73ecf8bb4cec73c51ca7014edb176fd Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Thu, 3 Mar 2016 04:42:27 +0100 Subject: [PATCH] use unicode_literals everywhere --- escpos/exceptions.py | 2 +- escpos/printer.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/escpos/exceptions.py b/escpos/exceptions.py index a31a304..ce2667a 100644 --- a/escpos/exceptions.py +++ b/escpos/exceptions.py @@ -23,7 +23,7 @@ Result/Exit codes: from __future__ import absolute_import from __future__ import division from __future__ import print_function -#from __future__ import unicode_literals +from __future__ import unicode_literals class Error(Exception): diff --git a/escpos/printer.py b/escpos/printer.py index de54cf9..baff92e 100644 --- a/escpos/printer.py +++ b/escpos/printer.py @@ -10,7 +10,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -#from __future__ import unicode_literals +from __future__ import unicode_literals import usb.core import usb.util @@ -252,10 +252,7 @@ class File(Escpos): :param msg: arbitrary code to be printed :type msg: bytes """ - if type(msg) is str: - self.device.write(msg.encode()) - else: - self.device.write(msg) + self.device.write(msg) def __del__(self): """ Close system file """