From a051a9d9297fa0c14e000d3cb8f47606cd9ae8a8 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Wed, 2 Jan 2013 22:46:08 +0100 Subject: [PATCH] Fixed PR 478 -- Removed superfluous try/except block. --- django/db/models/query.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/django/db/models/query.py b/django/db/models/query.py index 26b93b20bfc..d1f519aaf80 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -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)