summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@dreamhost.com>2012-05-04 13:17:41 -0400
committerDoug Hellmann <doug.hellmann@dreamhost.com>2012-05-04 13:17:41 -0400
commit5315a67c13c72bc9b4ffa27e8307fa64b73d9543 (patch)
tree92201bbe421beabcf2cfb78ce83523617d6f03b5
parent69324f49d857aec18553f5ee5ac7b5d81f37ea0f (diff)
downloadcliff-tablib-5315a67c13c72bc9b4ffa27e8307fa64b73d9543.tar.gz
python 3.2 does not have a unicode type so ignore the error if it is missing
-rw-r--r--cliff/formatters/table.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cliff/formatters/table.py b/cliff/formatters/table.py
index b7e978a..298c5f7 100644
--- a/cliff/formatters/table.py
+++ b/cliff/formatters/table.py
@@ -11,9 +11,12 @@ class TableFormatter(ListFormatter, SingleFormatter):
ALIGNMENTS = {
int: 'r',
str: 'l',
- unicode: 'l',
float: 'r',
}
+ try:
+ ALIGNMENTS[unicode] = 'l'
+ except NameError:
+ pass
def add_argument_group(self, parser):
group = parser.add_argument_group(