From 2c8620f94e4f2ca1f7af00a595230c994a9890cc Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Mon, 3 Jul 2017 09:42:28 +0200 Subject: [PATCH] raster.py: Py2 compat --- brother_ql/raster.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/brother_ql/raster.py b/brother_ql/raster.py index e631027..7e90df1 100644 --- a/brother_ql/raster.py +++ b/brother_ql/raster.py @@ -20,7 +20,10 @@ from .devicedependent import models, \ from . import BrotherQLError, BrotherQLUnsupportedCmd, BrotherQLUnknownModel, BrotherQLRasterError -from io import BytesIO +try: + from io import BytesIO +except: # Py2 + from cStringIO import StringIO as BytesIO logger = logging.getLogger(__name__)