Fix the syntax to be parseable under py3

This commit is contained in:
Ionel Cristian Mărieș 2013-08-27 14:29:29 +03:00
parent 66e1f35205
commit 3287aa2a18
1 changed files with 3 additions and 2 deletions

View File

@ -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"):