mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Use sqlite3 instead of pyspatialite for SpatiaLite connections
This commit is contained in:
parent
5b64af1365
commit
6402160526
@ -590,11 +590,7 @@ def startServerPlugin(packageName):
|
|||||||
|
|
||||||
def spatialite_connect(*args, **kwargs):
|
def spatialite_connect(*args, **kwargs):
|
||||||
"""returns a dbapi2.Connection to a SpatiaLite db
|
"""returns a dbapi2.Connection to a SpatiaLite db
|
||||||
either using pyspatialite if it is present
|
using the "mod_spatialite" extension (python3)"""
|
||||||
or using the "mod_spatialite" extension (python3)"""
|
|
||||||
try:
|
|
||||||
from pyspatialite import dbapi2
|
|
||||||
except ImportError:
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
con = sqlite3.dbapi2.connect(*args, **kwargs)
|
con = sqlite3.dbapi2.connect(*args, **kwargs)
|
||||||
con.enable_load_extension(True)
|
con.enable_load_extension(True)
|
||||||
@ -621,7 +617,6 @@ or using the "mod_spatialite" extension (python3)"""
|
|||||||
cur.close()
|
cur.close()
|
||||||
con.enable_load_extension(False)
|
con.enable_load_extension(False)
|
||||||
return con
|
return con
|
||||||
return dbapi2.connect(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
class OverrideCursor():
|
class OverrideCursor():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user