mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
Baby steps (2 to 3 at a time)
This commit is contained in:
@@ -95,7 +95,7 @@ class Database(object):
|
||||
self.cursor.execute(statement, arguments)
|
||||
else:
|
||||
self.cursor.execute(statement)
|
||||
except sqlite3.OperationalError, ex:
|
||||
except sqlite3.OperationalError as ex:
|
||||
if "locked" not in getSafeExString(ex):
|
||||
raise
|
||||
else:
|
||||
@@ -266,7 +266,7 @@ def setRestAPILog():
|
||||
try:
|
||||
conf.databaseCursor = Database(conf.database)
|
||||
conf.databaseCursor.connect("client")
|
||||
except sqlite3.OperationalError, ex:
|
||||
except sqlite3.OperationalError as ex:
|
||||
raise SqlmapConnectionException("%s ('%s')" % (ex, conf.database))
|
||||
|
||||
# Set a logging handler that writes log messages to a IPC database
|
||||
@@ -689,7 +689,7 @@ def server(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, adapter=REST
|
||||
eventlet.monkey_patch()
|
||||
logger.debug("Using adapter '%s' to run bottle" % adapter)
|
||||
run(host=host, port=port, quiet=True, debug=True, server=adapter)
|
||||
except socket.error, ex:
|
||||
except socket.error as ex:
|
||||
if "already in use" in getSafeExString(ex):
|
||||
logger.error("Address already in use ('%s:%s')" % (host, port))
|
||||
else:
|
||||
@@ -743,7 +743,7 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, username=Non
|
||||
|
||||
try:
|
||||
_client(addr)
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
if not isinstance(ex, urllib2.HTTPError) or ex.code == httplib.UNAUTHORIZED:
|
||||
errMsg = "There has been a problem while connecting to the "
|
||||
errMsg += "REST-JSON API server at '%s' " % addr
|
||||
@@ -798,7 +798,7 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, username=Non
|
||||
|
||||
try:
|
||||
argv = ["sqlmap.py"] + shlex.split(command)[1:]
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
logger.error("Error occurred while parsing arguments ('%s')" % ex)
|
||||
taskid = None
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user