Prevented a crash in the cursor wrappers on Oracle.

Fixed #22483 (again).

Forwardport of 5cd6429620 from stable/1.7.x
This commit is contained in:
Aymeric Augustin 2014-04-24 08:41:37 +02:00 committed by Tim Graham
parent b0f4eecfa7
commit 25209715d4
1 changed files with 6 additions and 2 deletions

View File

@ -36,8 +36,12 @@ class CursorWrapper(object):
def __exit__(self, type, value, traceback):
# Ticket #17671 - Close instead of passing thru to avoid backend
# specific behavior.
self.close()
# specific behavior. Catch errors liberally because errors in cleanup
# code aren't useful.
try:
self.close()
except self.db.Database.Error:
pass
# The following methods cannot be implemented in __getattr__, because the
# code must run when the method is invoked, not just when it is accessed.