'If the normal operating mode is "autocommit", switch back to that when
leaving transaction management.'

def _leave_transaction_management(self, managed):

    if (self.features.uses_autocommit and (not managed) and self.isolation_level):
        self._set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
