Skip to content

Commit bd25298

Browse files
authored
Verify module loaded when accessing contents
1 parent b048ba2 commit bd25298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cs50/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self, url, **kwargs):
7474
def connect(dbapi_connection, connection_record):
7575

7676
# Enable foreign key constraints
77-
if type(dbapi_connection) is sqlite3.Connection: # If back end is sqlite
77+
if 'sqlite3' in sys.modules and type(dbapi_connection) is sqlite3.Connection: # If back end is sqlite
7878
cursor = dbapi_connection.cursor()
7979
cursor.execute("PRAGMA foreign_keys=ON")
8080
cursor.close()

0 commit comments

Comments
 (0)