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

@@ -56,12 +56,12 @@ class Connector(GenericConnector):
except ImportError:
errMsg = "sqlmap requires 'python-sqlite2' third-party library "
errMsg += "in order to directly connect to the database '%s'" % self.db
raise SqlmapMissingDependence, errMsg
raise SqlmapMissingDependence(errMsg)
self.__sqlite = sqlite
self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError), msg:
raise SqlmapConnectionException, msg[0]
raise SqlmapConnectionException(msg[0])
self.setCursor()
self.connected()
@@ -79,7 +79,7 @@ class Connector(GenericConnector):
except self.__sqlite.OperationalError, msg:
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
except self.__sqlite.DatabaseError, msg:
raise SqlmapConnectionException, msg[0]
raise SqlmapConnectionException(msg[0])
self.connector.commit()

View File

@@ -57,7 +57,7 @@ class Enumeration(GenericEnumeration):
def searchColumn(self):
errMsg = "on SQLite you must specify the table and columns to dump"
raise SqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException(errMsg)
def getHostname(self):
warnMsg = "on SQLite it is not possible to enumerate the hostname"

View File

@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
def readFile(self, rFile):
errMsg = "on SQLite it is not possible to read files"
raise SqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException(errMsg)
def writeFile(self, wFile, dFile, fileType=None):
errMsg = "on SQLite it is not possible to write files"
raise SqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@@ -42,7 +42,7 @@ class Syntax(GenericSyntax):
index = expression[firstIndex+2:].find("'")
if index == -1:
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
raise SqlmapSyntaxException("Unenclosed ' in '%s'" % expression)
lastIndex = firstIndex + index + 3
old = expression[firstIndex:lastIndex]

View File

@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
def osCmd(self):
errMsg = "on SQLite it is not possible to execute commands"
raise SqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException(errMsg)
def osShell(self):
errMsg = "on SQLite it is not possible to execute commands"
raise SqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException(errMsg)
def osPwn(self):
errMsg = "on SQLite it is not possible to establish an "
errMsg += "out-of-band connection"
raise SqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException(errMsg)
def osSmb(self):
errMsg = "on SQLite it is not possible to establish an "
errMsg += "out-of-band connection"
raise SqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException(errMsg)