summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.com>2011-05-12 17:24:35 -0400
committerKenneth Reitz <me@kennethreitz.com>2011-05-12 17:24:35 -0400
commitc65fd4201fa836d13248f294df87e946d327fc59 (patch)
tree2b8528f2f3934651e51717166516e88fd4677022
parent79fb82d69d9c51e531c02a0af3f1bc49756fdaf4 (diff)
parent11bca4f7a28bffb90c67a89ae6069995ad0ee180 (diff)
downloadtablib-c65fd4201fa836d13248f294df87e946d327fc59.tar.gz
Merge branch 'compat' into feature/compat
-rw-r--r--tablib/core.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tablib/core.py b/tablib/core.py
index 9fd9ec4..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)
@@ -793,7 +793,7 @@ def import_set(stream):
format.import_set(data, stream)
return data
- except AttributeError as e:
+ except AttributeError:
return None