Fixed PR 478 -- Removed superfluous try/except block.

This commit is contained in:
Aymeric Augustin 2013-01-02 22:46:08 +01:00
parent a7b7efe78d
commit a051a9d929
1 changed files with 4 additions and 6 deletions

View File

@ -209,12 +209,10 @@ class QuerySet(object):
stop = None
qs.query.set_limits(start, stop)
return k.step and list(qs)[::k.step] or qs
try:
qs = self._clone()
qs.query.set_limits(k, k + 1)
return list(qs)[0]
except self.model.DoesNotExist as e:
raise IndexError(e.args)
def __and__(self, other):
self._merge_sanity_check(other)