Replacing old and deprecated raise Exception style (PEP8)

This commit is contained in:
Miroslav Stampar
2013-01-03 23:20:55 +01:00
parent 3a11d36c66
commit e4a3c015e5
78 changed files with 260 additions and 260 deletions

View File

@@ -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()

View File

@@ -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)

View File

@@ -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]

View File

@@ -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)