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:
@@ -51,7 +51,7 @@ def action():
|
||||
errMsg += ". Support for this DBMS will be implemented at "
|
||||
errMsg += "some point"
|
||||
|
||||
raise SqlmapUnsupportedDBMSException, errMsg
|
||||
raise SqlmapUnsupportedDBMSException(errMsg)
|
||||
|
||||
conf.dumper.singleString(conf.dbmsHandler.getFingerprint())
|
||||
|
||||
|
||||
@@ -879,7 +879,7 @@ def checkStability():
|
||||
kb.nullConnection = None
|
||||
else:
|
||||
errMsg = "Empty value supplied"
|
||||
raise SqlmapNoneDataException, errMsg
|
||||
raise SqlmapNoneDataException(errMsg)
|
||||
|
||||
elif test and test[0] in ("r", "R"):
|
||||
message = "please enter value for parameter 'regex': "
|
||||
@@ -896,7 +896,7 @@ def checkStability():
|
||||
kb.nullConnection = None
|
||||
else:
|
||||
errMsg = "Empty value supplied"
|
||||
raise SqlmapNoneDataException, errMsg
|
||||
raise SqlmapNoneDataException(errMsg)
|
||||
|
||||
else:
|
||||
checkDynamicContent(firstPage, secondPage)
|
||||
@@ -1027,7 +1027,7 @@ def checkNullConnection():
|
||||
|
||||
except SqlmapConnectionException, errMsg:
|
||||
errMsg = getUnicode(errMsg)
|
||||
raise SqlmapConnectionException, errMsg
|
||||
raise SqlmapConnectionException(errMsg)
|
||||
|
||||
return kb.nullConnection is not None
|
||||
|
||||
@@ -1037,7 +1037,7 @@ def checkConnection(suppressOutput=False):
|
||||
socket.getaddrinfo(conf.hostname, None)
|
||||
except socket.gaierror:
|
||||
errMsg = "host '%s' does not exist" % conf.hostname
|
||||
raise SqlmapConnectionException, errMsg
|
||||
raise SqlmapConnectionException(errMsg)
|
||||
|
||||
if not suppressOutput:
|
||||
infoMsg = "testing connection to the target url"
|
||||
@@ -1051,7 +1051,7 @@ def checkConnection(suppressOutput=False):
|
||||
|
||||
if not kb.originalPage and wasLastRequestHTTPError():
|
||||
errMsg = "unable to retrieve page content"
|
||||
raise SqlmapConnectionException, errMsg
|
||||
raise SqlmapConnectionException(errMsg)
|
||||
elif wasLastRequestDBMSError():
|
||||
warnMsg = "there is a DBMS error found in the HTTP response body "
|
||||
warnMsg += "which could interfere with the results of the tests"
|
||||
|
||||
@@ -117,7 +117,7 @@ def _selectInjection():
|
||||
raise SqlmapUserQuitException
|
||||
else:
|
||||
errMsg = "invalid choice"
|
||||
raise SqlmapValueException, errMsg
|
||||
raise SqlmapValueException(errMsg)
|
||||
|
||||
kb.injection = kb.injections[index]
|
||||
|
||||
@@ -496,7 +496,7 @@ def start():
|
||||
if kb.vainRun and not conf.multipleTargets:
|
||||
errMsg = "no parameter(s) found for testing in the provided data "
|
||||
errMsg += "(e.g. GET parameter 'id' in 'www.site.com/index.php?id=1')"
|
||||
raise SqlmapNoneDataException, errMsg
|
||||
raise SqlmapNoneDataException(errMsg)
|
||||
else:
|
||||
errMsg = "all tested parameters appear to be not injectable."
|
||||
|
||||
@@ -544,7 +544,7 @@ def start():
|
||||
errMsg += "expression that you have choosen "
|
||||
errMsg += "does not match exclusively True responses"
|
||||
|
||||
raise SqlmapNotVulnerableException, errMsg
|
||||
raise SqlmapNotVulnerableException(errMsg)
|
||||
else:
|
||||
# Flush the flag
|
||||
kb.testMode = False
|
||||
|
||||
Reference in New Issue
Block a user