

def __exit__(self, exc_type, exc_val, exc_tb):
    try:
        if exc_type:
            self.rollback()
        else:
            try:
                self.commit()
            except:
                self.rollback()
                raise
    finally:
        self.db.set_autocommit(self._orig_autocommit)

dataset/ETHPy150Open coleifer/peewee/peewee.py savepoint.__exit__/original