'This ensures we dont error if the connection has already been closed.'

def close(self, reconnect=False):

    if (self.connection is not None):
        if (not self.connection.closed):
            try:
                self.connection.close()
            except Database.InterfaceError:
                pass
        self.connection = None
