From e18486cc36f879c83eefc74a408ba411eeb35060 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sun, 17 Dec 2023 14:40:13 -0500 Subject: [PATCH 1/2] fixes #178 --- src/cs50/sql.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cs50/sql.py b/src/cs50/sql.py index de3ad56..ef011da 100644 --- a/src/cs50/sql.py +++ b/src/cs50/sql.py @@ -399,6 +399,8 @@ def teardown_appcontext(exception): # If constraint violated except sqlalchemy.exc.IntegrityError as e: + if self._autocommit: + connection.execute(sqlalchemy.text("ROLLBACK")) self._logger.error(termcolor.colored(_statement, "red")) e = ValueError(e.orig) e.__cause__ = None From 781c1c201090493a65793f586174e14644163f36 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sun, 17 Dec 2023 14:40:26 -0500 Subject: [PATCH 2/2] increments version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 23f6b01..10ceb30 100644 --- a/setup.py +++ b/setup.py @@ -18,5 +18,5 @@ package_dir={"": "src"}, packages=["cs50"], url="https://github.com/cs50/python-cs50", - version="9.3.0" + version="9.3.1" )