mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
Replacing old and deprecated raise Exception style (PEP8)
This commit is contained in:
@@ -37,7 +37,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = psycopg2.connect(host=self.hostname, user=self.user, password=self.password, database=self.db, port=self.port)
|
||||
except psycopg2.OperationalError, msg:
|
||||
raise SqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException(msg)
|
||||
|
||||
self.connector.set_client_encoding('UNICODE')
|
||||
|
||||
@@ -60,7 +60,7 @@ class Connector(GenericConnector):
|
||||
except (psycopg2.OperationalError, psycopg2.ProgrammingError), msg:
|
||||
logger.warn(("(remote) %s" % msg).strip())
|
||||
except psycopg2.InternalError, msg:
|
||||
raise SqlmapConnectionException, msg
|
||||
raise SqlmapConnectionException(msg)
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class Filesystem(GenericFilesystem):
|
||||
def unionWriteFile(self, wFile, dFile, fileType):
|
||||
errMsg = "PostgreSQL does not support file upload with UNION "
|
||||
errMsg += "query SQL injection technique"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def stackedWriteFile(self, wFile, dFile, fileType):
|
||||
wFileSize = os.path.getsize(wFile)
|
||||
@@ -39,7 +39,7 @@ class Filesystem(GenericFilesystem):
|
||||
if wFileSize > 8192:
|
||||
errMsg = "on PostgreSQL it is not possible to write files "
|
||||
errMsg += "bigger than 8192 bytes at the moment"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
self.oid = randomInt()
|
||||
|
||||
|
||||
@@ -29,7 +29,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]
|
||||
@@ -52,7 +52,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]
|
||||
|
||||
@@ -53,7 +53,7 @@ class Takeover(GenericTakeover):
|
||||
majorVer = "8.2"
|
||||
else:
|
||||
errMsg = "unsupported feature on versions of PostgreSQL before 8.2"
|
||||
raise SqlmapUnsupportedFeatureException, errMsg
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
if Backend.isOs(OS.WINDOWS):
|
||||
self.udfLocalFile += "/postgresql/windows/%d/%s/lib_postgresqludf_sys.dll" % (Backend.getArch(), majorVer)
|
||||
|
||||
Reference in New Issue
Block a user