From 11bca4f7a28bffb90c67a89ae6069995ad0ee180 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 12 May 2011 17:20:22 -0400 Subject: [PATCH] callable check fix --- tablib/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tablib/core.py b/tablib/core.py index 55d057b..4cef83c 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -13,7 +13,6 @@ from copy import copy from operator import itemgetter from tablib import formats -import collections from tablib.compat import OrderedDict @@ -276,7 +275,8 @@ class Dataset(object): else: header = [] - if len(col) == 1 and isinstance(col[0], collections.Callable): + if len(col) == 1 and hasattr(col[0], '__call__'): + col = list(map(col[0], self._data)) col = tuple(header + col) @@ -547,7 +547,7 @@ class Dataset(object): col = list(col) # Callable Columns... - if len(col) == 1 and isinstance(col[0], collections.Callable): + if len(col) == 1 and hasattr(col[0], '__call__'): col = list(map(col[0], self._data)) col = self._clean_col(col)