

def get_conn(self):
    if self.__local.context_stack:
        conn = self.__local.context_stack[(- 1)].connection
        if (conn is not None):
            return conn
    if self.__local.closed:
        self.connect()
    return self.__local.conn

dataset/ETHPy150Open coleifer/peewee/peewee.py Database.get_conn/original