mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 04:53:48 +03:00
no need for obsolete (and hard to find) sqlite module when sqlite3 handles both database versions
This commit is contained in:
parent
27496b91b2
commit
e810fe7b0b
|
@ -684,7 +684,7 @@ def parseTargetDirect():
|
|||
"MySQL": [MYSQL_ALIASES, "python-mysqldb", "http://mysql-python.sourceforge.net/"],
|
||||
"PostgreSQL": [PGSQL_ALIASES, "python-psycopg2", "http://initd.org/psycopg/"],
|
||||
"Oracle": [ORACLE_ALIASES, "python cx_Oracle", "http://cx-oracle.sourceforge.net/"],
|
||||
"SQLite": [SQLITE_ALIASES, "python-pysqlite2 and python-sqlite", "http://pysqlite.googlecode.com/"],
|
||||
"SQLite": [SQLITE_ALIASES, "python-pysqlite2", "http://pysqlite.googlecode.com/"],
|
||||
"Access": [ACCESS_ALIASES, "python-pyodbc", "http://pyodbc.googlecode.com/"],
|
||||
"Firebird": [FIREBIRD_ALIASES, "python-kinterbasdb", "http://kinterbasdb.sourceforge.net/"] }
|
||||
|
||||
|
@ -720,7 +720,6 @@ def parseTargetDirect():
|
|||
elif dbmsName == "Oracle":
|
||||
import cx_Oracle
|
||||
elif dbmsName == "SQLite":
|
||||
import sqlite
|
||||
import sqlite3
|
||||
elif dbmsName == "Access":
|
||||
import pyodbc
|
||||
|
|
|
@ -23,7 +23,6 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
"""
|
||||
|
||||
try:
|
||||
import sqlite
|
||||
import sqlite3
|
||||
except ImportError, _:
|
||||
pass
|
||||
|
@ -54,15 +53,9 @@ class Connector(GenericConnector):
|
|||
self.checkFileDb()
|
||||
|
||||
try:
|
||||
self.connector = sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
|
||||
except (sqlite.DatabaseError, sqlite.OperationalError), _:
|
||||
errMsg = "unable to connect using SQLite 2 library, trying with SQLite 3"
|
||||
logger.error(errMsg)
|
||||
|
||||
try:
|
||||
self.connector = sqlite3.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
|
||||
except (sqlite.DatabaseError, sqlite.OperationalError), msg:
|
||||
raise sqlmapConnectionException, msg[0]
|
||||
self.connector = sqlite3.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
|
||||
except (sqlite3.DatabaseError, sqlite3.OperationalError), msg:
|
||||
raise sqlmapConnectionException, msg[0]
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
|
|
Loading…
Reference in New Issue
Block a user