Fixed PR 478 -- Removed superfluous try/except block.
This commit is contained in:
parent
a7b7efe78d
commit
a051a9d929
|
@ -209,12 +209,10 @@ class QuerySet(object):
|
||||||
stop = None
|
stop = None
|
||||||
qs.query.set_limits(start, stop)
|
qs.query.set_limits(start, stop)
|
||||||
return k.step and list(qs)[::k.step] or qs
|
return k.step and list(qs)[::k.step] or qs
|
||||||
try:
|
|
||||||
qs = self._clone()
|
qs = self._clone()
|
||||||
qs.query.set_limits(k, k + 1)
|
qs.query.set_limits(k, k + 1)
|
||||||
return list(qs)[0]
|
return list(qs)[0]
|
||||||
except self.model.DoesNotExist as e:
|
|
||||||
raise IndexError(e.args)
|
|
||||||
|
|
||||||
def __and__(self, other):
|
def __and__(self, other):
|
||||||
self._merge_sanity_check(other)
|
self._merge_sanity_check(other)
|
||||||
|
|
Loading…
Reference in New Issue