Skip to content

Commit

Permalink
[BUGFIX][Processing] Fix spatialite version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Apr 20, 2017
1 parent ca40e11 commit b35bbb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/qgis/spatialite_utils.py
Expand Up @@ -26,6 +26,7 @@
__revision__ = '$Format:%H$'

from pyspatialite import dbapi2 as sqlite
import re


class DbError(Exception):
Expand Down Expand Up @@ -64,11 +65,10 @@ def init_spatialite(self):
try:
self._exec_sql(c, u'SELECT spatialite_version()')
rep = c.fetchall()
v = [int(a) for a in rep[0][0].split('.')]
vv = v[0] * 100000 + v[1] * 1000 + v[2] * 10
v = [int(x) if x.isdigit() else x for x in re.findall("\d+|[a-zA-Z]+", rep[0][0])]

# Add spatialite support
if vv >= 401000:
if v >= [4, 1, 0]:
# 4.1 and above
sql = "SELECT initspatialmetadata(1)"
else:
Expand Down

0 comments on commit b35bbb6

Please sign in to comment.