mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 21:21:33 +00:00
Replacing old and deprecated raise Exception style (PEP8)
This commit is contained in:
@@ -42,7 +42,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
|
||||
except pymssql.OperationalError, msg:
|
||||
raise SqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException(msg)
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -60,7 +60,7 @@ class Connector(GenericConnector):
|
||||
except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||
except pymssql.InternalError, msg:
|
||||
raise SqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException(msg)
|
||||
|
||||
def select(self, query):
|
||||
self.execute(query)
|
||||
|
||||
@@ -172,7 +172,7 @@ class Enumeration(GenericEnumeration):
|
||||
if ',' in conf.db:
|
||||
errMsg = "only one database name is allowed when enumerating "
|
||||
errMsg += "the tables' columns"
|
||||
raise SqlmapMissingMandatoryOptionException, errMsg
|
||||
raise SqlmapMissingMandatoryOptionException(errMsg)
|
||||
|
||||
conf.db = safeSQLIdentificatorNaming(conf.db)
|
||||
|
||||
@@ -197,7 +197,7 @@ class Enumeration(GenericEnumeration):
|
||||
else:
|
||||
errMsg = "unable to retrieve the tables "
|
||||
errMsg += "on database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
|
||||
raise SqlmapNoneDataException, errMsg
|
||||
raise SqlmapNoneDataException(errMsg)
|
||||
|
||||
for tbl in tblList:
|
||||
tblList[tblList.index(tbl)] = safeSQLIdentificatorNaming(tbl)
|
||||
|
||||
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
|
||||
|
||||
def readFile(self, rFile):
|
||||
errMsg = "on Sybase it is not possible to read files"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def writeFile(self, wFile, dFile, fileType=None):
|
||||
errMsg = "on Sybase it is not possible to write files"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
|
||||
|
||||
def osCmd(self):
|
||||
errMsg = "on Sybase it is not possible to execute commands"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def osShell(self):
|
||||
errMsg = "on Sybase it is not possible to execute commands"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def osPwn(self):
|
||||
errMsg = "on Sybase it is not possible to establish an "
|
||||
errMsg += "out-of-band connection"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def osSmb(self):
|
||||
errMsg = "on Sybase 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