Skip to content

Commit 42482f9

Browse files
committed
logging bytes-abbreviated _statement instead
1 parent 6a5bee0 commit 42482f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cs50/sql.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,15 @@ def teardown_appcontext(exception):
384384

385385
# If constraint violated
386386
except sqlalchemy.exc.IntegrityError as e:
387-
self._logger.error(termcolor.colored(statement, "red"))
387+
self._logger.error(termcolor.colored(_statement, "red"))
388388
e = ValueError(e.orig)
389389
e.__cause__ = None
390390
raise e
391391

392392
# If user error
393393
except (sqlalchemy.exc.OperationalError, sqlalchemy.exc.ProgrammingError) as e:
394394
self._disconnect()
395-
self._logger.error(termcolor.colored(statement, "red"))
395+
self._logger.error(termcolor.colored(_statement, "red"))
396396
e = RuntimeError(e.orig)
397397
e.__cause__ = None
398398
raise e

0 commit comments

Comments
 (0)