mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 06:01:29 +00:00
Dealing with deprecated raises
This commit is contained in:
@@ -277,7 +277,7 @@ def setRestAPILog():
|
||||
conf.databaseCursor = Database(conf.database)
|
||||
conf.databaseCursor.connect("client")
|
||||
except sqlite3.OperationalError, ex:
|
||||
raise SqlmapConnectionException, "%s ('%s')" % (ex, conf.database)
|
||||
raise SqlmapConnectionException("%s ('%s')" % (ex, conf.database))
|
||||
|
||||
# Set a logging handler that writes log messages to a IPC database
|
||||
logger.removeHandler(LOGGER_HANDLER)
|
||||
|
||||
@@ -92,7 +92,7 @@ class HashDB(object):
|
||||
except sqlite3.DatabaseError, ex:
|
||||
errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, getSafeExString(ex))
|
||||
errMsg += "If the problem persists please rerun with `--flush-session`"
|
||||
raise SqlmapConnectionException, errMsg
|
||||
raise SqlmapConnectionException(errMsg)
|
||||
else:
|
||||
break
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class SQLAlchemy(GenericConnector):
|
||||
try:
|
||||
if not self.port and self.db:
|
||||
if not os.path.exists(self.db):
|
||||
raise SqlmapFilePathException, "the provided database file '%s' does not exist" % self.db
|
||||
raise SqlmapFilePathException("the provided database file '%s' does not exist" % self.db)
|
||||
|
||||
_ = conf.direct.split("//", 1)
|
||||
conf.direct = "%s////%s" % (_[0], os.path.abspath(self.db))
|
||||
|
||||
Reference in New Issue
Block a user