1
0
mirror of https://github.com/django/django.git synced 2025-07-06 10:49:17 +00:00

queryset-refactor: Changed execute_sql() to not return an iterator in the

non-MULTI cases when there is an empty result set.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6860 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-12-03 03:31:26 +00:00
parent 7b9732a4a4
commit 4ea96c0468

View File

@ -988,7 +988,10 @@ class Query(object):
try:
sql, params = self.as_sql()
except EmptyResultSet:
raise StopIteration
if result_type == MULTI:
raise StopIteration
else:
return
cursor = self.connection.cursor()
cursor.execute(sql, params)