mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-29 07:05:04 +08:00
MAINT: Just the value if dtype doesn't have a name.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user