prprprus / PyMySQLPool

PyMySQL-based database connection pool.
MIT License
60 stars 21 forks source link

Problem with end program #17

Closed hudojnick closed 4 years ago

hudojnick commented 4 years ago

I can't close or end my program... This is my code and I tried even sys.exit() and nothing don't close my program...

#!/usr/bin/python3
from settings import *
from pymysqlpool.pool import Pool
import sys

pool = Pool(host=DB_HOST, user=DB_USER, password=DB_PASS, db=DB_DB, autocommit=True)
pool.init()
connection = pool.get_conn()
cursor = connection.cursor()
get_c = "select * from history"
cursor.execute(get_c)
c = cursor.fetchone()
print(c)
connection.close()
cursor.close()
pool.release(connection)
sys.exit()