Check types with issubdtype

This commit is contained in:
Juan Nunez-Iglesias
2016-06-17 17:56:52 -04:00
parent f2f9a3202d
commit 24bab75dc3
+1 -2
View File
@@ -116,8 +116,7 @@ def greycomatrix(image, distances, angles, levels=None, symmetric=False,
"other than uint8. The resulting matrix will be at "
"least levels ** 2 in size.")
if (image.dtype in (np.int8, np.int16, np.int32, np.int64) and
np.any(image < 0)):
if np.issubdtype(image.dtype, np.signedinteger) and np.any(image < 0):
raise ValueError("Negative-valued images are not supported.")
if levels is None: