From 3287aa2a180caf6f951217950e50f958904e8948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Tue, 27 Aug 2013 14:29:29 +0300 Subject: [PATCH] Fix the syntax to be parseable under py3 --- django_tables2/tables.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django_tables2/tables.py b/django_tables2/tables.py index 6d2785d..a1cc7ea 100644 --- a/django_tables2/tables.py +++ b/django_tables2/tables.py @@ -45,11 +45,12 @@ class TableData(object): 'neither' % type(data).__name__ ) else: - raise ValueError, ValueError( + # really horrible, but this syntax is not supported on PY3 and would not work otherwise + exec """raise ValueError, ( 'data must be QuerySet-like (have count and ' 'order_by) or support list(data) -- %s has ' 'neither. Original exception: %s' % (type(data).__name__, ex) - ), sys.exc_info()[2] + ), sys.exc_info()[2]""" def __len__(self): if not hasattr(self, "_length"):