MAINT: Just the value if dtype doesn't have a name.

This commit is contained in:
Scott Sanderson
2015-12-10 17:34:38 -05:00
parent 4b897a22f4
commit 4469fbef76
+3 -3
View File
@@ -111,10 +111,10 @@ def _expect_dtype(_dtype_or_dtype_tuple):
def display_bad_value(value):
# If the bad value has a dtype, but it's wrong, show the dtype name.
if hasattr(value, 'dtype'):
try:
return value.dtype.name
# Otherwise, show the value itself.
return value
except AttributeError:
return value
return make_check(
exc_type=TypeError,