From 4469fbef76cd143a1c8f1fd7ac2d92543e51e459 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Thu, 10 Dec 2015 17:34:38 -0500 Subject: [PATCH] MAINT: Just the value if dtype doesn't have a name. --- zipline/utils/input_validation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zipline/utils/input_validation.py b/zipline/utils/input_validation.py index 8ef0ed70..948f8108 100644 --- a/zipline/utils/input_validation.py +++ b/zipline/utils/input_validation.py @@ -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,