summaryrefslogtreecommitdiff
path: root/scss/functions/compass/images.py
diff options
context:
space:
mode:
Diffstat (limited to 'scss/functions/compass/images.py')
-rw-r--r--scss/functions/compass/images.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/scss/functions/compass/images.py b/scss/functions/compass/images.py
index 45fed74..1eeea38 100644
--- a/scss/functions/compass/images.py
+++ b/scss/functions/compass/images.py
@@ -1,6 +1,7 @@
"""Image utilities ported from Compass."""
from __future__ import absolute_import
+from __future__ import print_function
import base64
import hashlib
@@ -9,19 +10,15 @@ import mimetypes
import os.path
import time
+import six
+
from scss import config
from scss.functions.compass import _image_size_cache
+from scss.functions.compass.helpers import add_cache_buster
from scss.functions.library import FunctionLibrary
from scss.types import ColorValue, ListValue, NumberValue, StringValue
from scss.util import escape
-from scss.functions.compass.helpers import add_cache_buster
-
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-
try:
from PIL import Image
except ImportError:
@@ -153,7 +150,7 @@ def _image_url(path, only_path=False, cache_buster=True, dst_color=None, src_col
if cache_buster:
url = add_cache_buster(url, filetime)
if inline:
- output = StringIO()
+ output = six.BytesIO()
new_image.save(output, format='PNG')
contents = output.getvalue()
output.close()