[source/native] handle newer Integrity error messages from sqlite > 3.7 stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Mon, 24 Nov 2014 16:22:40 +0100
branchstable
changeset 10049 8facecb02e42
parent 10048 7d9256aab337
child 10050 cda4b066933f
[source/native] handle newer Integrity error messages from sqlite > 3.7 Similar to a0cf2993b6d3 that was done for 3.18.
server/sources/native.py
--- a/server/sources/native.py	Mon Nov 24 15:43:18 2014 +0100
+++ b/server/sources/native.py	Mon Nov 24 16:22:40 2014 +0100
@@ -769,6 +769,9 @@
                         raise UniqueTogetherError(etype, rtypes)
                     # sqlite
                     mo = re.search('columns (.*) are not unique', arg)
+                    if mo is None:
+                        # sqlite > 3.7
+                        mo = re.search('UNIQUE constraint failed: (.*)', arg)
                     if mo is not None: # sqlite in use
                         # we left chop the 'cw_' prefix of attribute names
                         rtypes = [c.strip()[3:]