diff --git a/skimage/_shared/utils.py b/skimage/_shared/utils.py index e1642102..aad9220d 100644 --- a/skimage/_shared/utils.py +++ b/skimage/_shared/utils.py @@ -2,18 +2,7 @@ import warnings import functools -__all__ = ['deprecated', 'is_str'] - - -try: - isinstance("", basestring) - def is_str(s): - """Return True if `s` is a string. Safe for Python 2 and 3.""" - return isinstance(s, basestring) -except NameError: - def is_str(s): - """Return True if `s` is a string. Safe for Python 2 and 3.""" - return isinstance(s, str) +__all__ = ['deprecated'] class deprecated(object): diff --git a/skimage/color/colorlabel.py b/skimage/color/colorlabel.py index f1c91d67..41974f38 100644 --- a/skimage/color/colorlabel.py +++ b/skimage/color/colorlabel.py @@ -4,7 +4,7 @@ import itertools import numpy as np from skimage import img_as_float -from skimage._shared.utils import is_str +from skimage._shared import six from .colorconv import rgb2gray, gray2rgb from . import rgb_colors @@ -30,7 +30,7 @@ def _rgb_vector(color): color : str or array Color name in `color_dict` or RGB float values between [0, 1]. """ - if is_str(color): + if isinstance(color, six.string_types): color = color_dict[color] # slice to handle RGBA colors return np.array(color[:3]).reshape(1, 3)