diff --git a/brother_ql/backends/linux_kernel.py b/brother_ql/backends/linux_kernel.py index 2a6bdc9..5a1c8a0 100755 --- a/brother_ql/backends/linux_kernel.py +++ b/brother_ql/backends/linux_kernel.py @@ -5,6 +5,9 @@ Backend to support Brother QL-series printers via the linux kernel USB printer i Works on Linux. """ +from __future__ import unicode_literals +from builtins import str + import glob, os, time, select from .generic import BrotherQLBackendGeneric diff --git a/brother_ql/backends/network.py b/brother_ql/backends/network.py index 6750f98..b32448c 100755 --- a/brother_ql/backends/network.py +++ b/brother_ql/backends/network.py @@ -5,6 +5,9 @@ Backend to support Brother QL-series printers via network. Works cross-platform. """ +from __future__ import unicode_literals +from builtins import str + import socket, os, time, select from .generic import BrotherQLBackendGeneric diff --git a/brother_ql/backends/pyusb.py b/brother_ql/backends/pyusb.py index 2faf845..d0fd41d 100755 --- a/brother_ql/backends/pyusb.py +++ b/brother_ql/backends/pyusb.py @@ -8,6 +8,9 @@ Requires PyUSB: https://github.com/walac/pyusb/ Install via `pip install pyusb` """ +from __future__ import unicode_literals +from builtins import str + import time import usb.core diff --git a/brother_ql/conversion.py b/brother_ql/conversion.py index bf1a303..2340f25 100755 --- a/brother_ql/conversion.py +++ b/brother_ql/conversion.py @@ -1,6 +1,7 @@ #!/usr/bin/env python -from __future__ import division +from __future__ import division, unicode_literals +from builtins import str import logging @@ -12,11 +13,6 @@ from brother_ql.devicedependent import label_type_specs, ENDLESS_LABEL, DIE_CUT_ from brother_ql import BrotherQLUnsupportedCmd from brother_ql.image_trafos import filtered_hsv -try: - unicode -except: - unicode = str - logger = logging.getLogger(__name__) logging.getLogger("PIL.PngImagePlugin").setLevel(logging.WARNING) @@ -83,7 +79,7 @@ def convert(qlr, images, label, **kwargs): for image in images: if isinstance(image, Image.Image): im = image - elif isinstance(image, (unicode, str)): + elif isinstance(image, str): im = Image.open(image) else: raise NotImplementedError("The image argument needs to be an Image() instance or the filename to an image.")