Skip to content

Commit 0735e45

Browse files
committedOct 29, 2016
catching IntegrityError now and returning None
1 parent e1bb087 commit 0735e45

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ BUILD_DIR = build
22
DESCRIPTION = CS50 Library for Python
33
MAINTAINER = CS50 <sysadmins@cs50.harvard.edu>
44
NAME = lib50-python
5-
VERSION = 1.2.3
5+
VERSION = 1.2.4
66

77
.PHONY: bash
88
bash:

‎src/sql.py

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def execute(self, text, *multiparams, **params):
3434
else:
3535
return result.rowcount
3636

37+
except sqlalchemy.exc.IntegrityError:
38+
return None
39+
3740
except Exception as e:
3841
raise RuntimeError(e)
3942

0 commit comments

Comments
 (0)
Please sign in to comment.