Commit 7421e1e3 authored by Shai Berger's avatar Shai Berger
Browse files

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

Refs #22483

Backport of 53d97e4f from master
parent bee118a7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -917,6 +917,13 @@ class FormatStylePlaceholderCursor(object):
    def fetchall(self):
        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):
        return VariableWrapper(self.cursor.var(*args))