BUG: basestring not defined on PY3

This commit is contained in:
cgohlke
2013-10-10 21:16:14 -07:00
parent e3c7ad0113
commit ea357a4464
+3 -1
View File
@@ -11,6 +11,8 @@ except ImportError:
from skimage.util import img_as_ubyte
from skimage._shared import six
def imread(fname, dtype=None):
"""Load an image from file.
@@ -104,7 +106,7 @@ def imsave(fname, arr, format_str=None):
arr = arr.astype(np.uint8)
# default to PNG if file-like object
if not isinstance(fname, basestring) and format_str is None:
if not isinstance(fname, six.string_types) and format_str is None:
format_str = "PNG"
img = Image.fromstring(mode, (arr.shape[1], arr.shape[0]), arr.tostring())