Skip to content

Commit b048ba2

Browse files
authored
Load sqlite module if sqlite connection
1 parent fcc68a1 commit b048ba2

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
@@ -51,12 +51,12 @@ def __init__(self, url, **kwargs):
5151
import re
5252
import sqlalchemy
5353
import sqlalchemy.orm
54-
import sqlite3
5554
import threading
5655

5756
# Require that file already exist for SQLite
5857
matches = re.search(r"^sqlite:///(.+)$", url)
5958
if matches:
59+
import sqlite3
6060
if not os.path.exists(matches.group(1)):
6161
raise RuntimeError("does not exist: {}".format(matches.group(1)))
6262
if not os.path.isfile(matches.group(1)):

0 commit comments

Comments
 (0)