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:
@@ -37,7 +37,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.connector = pymysql.connect(host=self.hostname, user=self.user, passwd=self.password, db=self.db, port=self.port, connect_timeout=conf.timeout, use_unicode=True)
|
||||
except (pymysql.OperationalError, pymysql.InternalError), msg:
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException(msg[1])
|
||||
|
||||
self.setCursor()
|
||||
self.connected()
|
||||
@@ -58,7 +58,7 @@ class Connector(GenericConnector):
|
||||
except (pymysql.OperationalError, pymysql.ProgrammingError), msg:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except pymysql.InternalError, msg:
|
||||
raise SqlmapConnectionException, msg[1]
|
||||
raise SqlmapConnectionException(msg[1])
|
||||
|
||||
self.connector.commit()
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class Filesystem(GenericFilesystem):
|
||||
logger.warn(warnMsg)
|
||||
result = self.nonStackedReadFile(rFile)
|
||||
else:
|
||||
raise SqlmapNoneDataException, warnMsg
|
||||
raise SqlmapNoneDataException(warnMsg)
|
||||
else:
|
||||
length = int(length)
|
||||
sustrLen = 1024
|
||||
|
||||
@@ -41,7 +41,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]
|
||||
|
||||
Reference in New Issue
Block a user