Skip to content

Commit 114a38a

Browse files
committed
Merge pull request matplotlib#4925 from jenshnielsen/numpydeprecation
MNT: Make sure _edgecolors is a string before comparison to string.
2 parents ed5253d + 5e8fb62 commit 114a38a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/collections.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ def get_facecolor(self):
617617
get_facecolors = get_facecolor
618618

619619
def get_edgecolor(self):
620-
if self._edgecolors == str('face'):
620+
if (isinstance(self._edgecolors, six.string_types)
621+
and self._edgecolors == str('face')):
621622
return self.get_facecolors()
622623
else:
623624
return self._edgecolors
@@ -678,7 +679,8 @@ def set_alpha(self, alpha):
678679
except (AttributeError, TypeError, IndexError):
679680
pass
680681
try:
681-
if self._edgecolors_original != str('face'):
682+
if (not isinstance(self._edgecolors_original, six.string_types)
683+
or self._edgecolors_original != str('face')):
682684
self._edgecolors = mcolors.colorConverter.to_rgba_array(
683685
self._edgecolors_original, self._alpha)
684686
except (AttributeError, TypeError, IndexError):

0 commit comments

Comments
 (0)