0
0
mirror of https://github.com/django/django.git synced 2024-11-29 14:46:18 +01:00

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

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)
qs = self._clone()
qs.query.set_limits(k, k + 1)
return list(qs)[0]
def __and__(self, other):
self._merge_sanity_check(other)