Skip to content

Error in chapter15/populate_db.py #6

@yehuihe

Description

@yehuihe

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

UnboundLocalError: local variable 'db' referenced before assignment

pull db declaration outside try

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions