1
0
mirror of https://github.com/django/django.git synced 2024-12-25 02:26:12 +00:00

[1.7.x] Made sure cursor.close() does not complain if cursor is already closed on Oracle

Refs #22483

Backport of 53d97e4fe3 from master
This commit is contained in:
Shai Berger 2014-04-25 00:36:40 +03:00
parent bee118a701
commit 7421e1e320

View File

@ -917,6 +917,13 @@ class FormatStylePlaceholderCursor(object):
def fetchall(self): def fetchall(self):
return tuple(_rowfactory(r, self.cursor) for r in self.cursor.fetchall()) return tuple(_rowfactory(r, self.cursor) for r in self.cursor.fetchall())
def close(self):
try:
self.cursor.close()
except Database.InterfaceError:
# already closed
pass
def var(self, *args): def var(self, *args):
return VariableWrapper(self.cursor.var(*args)) return VariableWrapper(self.cursor.var(*args))