mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 22:21:30 +00:00
Replacing old and deprecated raise Exception style (PEP8)
This commit is contained in:
@@ -35,7 +35,7 @@ class Connector(GenericConnector):
|
||||
if not IS_WIN:
|
||||
errMsg = "currently, direct connection to Microsoft Access database(s) "
|
||||
errMsg += "is restricted to Windows platforms"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
self.initConnection()
|
||||
self.checkFileDb()
|
||||
@@ -43,7 +43,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb)};Dbq=%s;Uid=Admin;Pwd=;' % self.db)
|
||||
except (pyodbc.Error, pyodbc.OperationalError), msg:
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException(msg[1])
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -61,7 +61,7 @@ class Connector(GenericConnector):
|
||||
except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except pyodbc.Error, msg:
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException(msg[1])
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
def readFile(self, rFile):
|
||||
errMsg = "on Microsoft Access it is not possible to read files"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "on Microsoft Access it is not possible to write files"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
@@ -24,7 +24,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
|
||||
raise SqlmapSyntaxException("Unenclosed ' in '%s'" % expression)
|
||||
|
||||
lastIndex = firstIndex + index
|
||||
old = "'%s'" % expression[firstIndex:lastIndex]
|
||||
@@ -56,7 +56,7 @@ class Syntax(GenericSyntax):
|
||||
index = expression[firstIndex:].find(")")
|
||||
|
||||
if index == -1:
|
||||
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
|
||||
raise SqlmapSyntaxException("Unenclosed ) in '%s'" % expression)
|
||||
|
||||
lastIndex = firstIndex + index + 1
|
||||
old = expression[firstIndex:lastIndex]
|
||||
|
||||
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
|
||||
|
||||
def osCmd(self):
|
||||
errMsg = "on Microsoft Access it is not possible to execute commands"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "on Microsoft Access it is not possible to execute commands"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "on Microsoft Access it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "on Microsoft Access it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
Reference in New Issue
Block a user