mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -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):
|
||||
"""returns a dbapi2.Connection to a SpatiaLite db
|
||||
either using pyspatialite if it is present
|
||||
or using the "mod_spatialite" extension (python3)"""
|
||||
try:
|
||||
from pyspatialite import dbapi2
|
||||
except ImportError:
|
||||
using the "mod_spatialite" extension (python3)"""
|
||||
import sqlite3
|
||||
con = sqlite3.dbapi2.connect(*args, **kwargs)
|
||||
con.enable_load_extension(True)
|
||||
@ -621,7 +617,6 @@ or using the "mod_spatialite" extension (python3)"""
|
||||
cur.close()
|
||||
con.enable_load_extension(False)
|
||||
return con
|
||||
return dbapi2.connect(*args, **kwargs)
|
||||
|
||||
|
||||
class OverrideCursor():
|
||||
|
Loading…
x
Reference in New Issue
Block a user