Open yehuihe opened 2 years ago
chapter15/populate_db.py
In both setup_db and add_quotes. db = sqlite3.connect('data/quotes.sqlite3') can't declared inside try/except statement. Doing so will raise
setup_db
add_quotes
db = sqlite3.connect('data/quotes.sqlite3')
UnboundLocalError: local variable 'db' referenced before assignment
pull db declaration outside try
chapter15/populate_db.py
In both
setup_db
andadd_quotes
.db = sqlite3.connect('data/quotes.sqlite3')
can't declared inside try/except statement. Doing so will raiseUnboundLocalError: local variable 'db' referenced before assignment
pull db declaration outside try