[1.4.x] -- Fixed Python 2.5 compatibility issues

This commit is contained in:
Anssi Kääriäinen 2012-09-30 16:36:01 +03:00
parent 1f537335d9
commit 4dba4ed548
2 changed files with 5 additions and 3 deletions

View File

@ -131,7 +131,7 @@ class FieldListFilter(ListFilter):
def queryset(self, request, queryset):
try:
return queryset.filter(**self.used_parameters)
except ValidationError as e:
except ValidationError, e:
raise IncorrectLookupParameters(e)
@classmethod

View File

@ -43,13 +43,15 @@ class PermWrapperTests(TestCase):
Test that 'something' in PermWrapper doesn't end up in endless loop.
"""
perms = PermWrapper(MockUser())
with self.assertRaises(TypeError):
def raises():
self.EQLimiterObject() in perms
self.assertRaises(raises, TypeError)
def test_permlookupdict_in(self):
pldict = PermLookupDict(MockUser(), 'mockapp')
with self.assertRaises(TypeError):
def raises():
self.EQLimiterObject() in pldict
self.assertRaises(raises, TypeError)
class AuthContextProcessorTests(TestCase):