mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 05:01:30 +00:00
Baby steps (2 to 3 at a time)
This commit is contained in:
@@ -814,7 +814,7 @@ def cmdLineParser(argv=None):
|
||||
try:
|
||||
for arg in shlex.split(command):
|
||||
argv.append(getUnicode(arg, encoding=sys.stdin.encoding))
|
||||
except ValueError, ex:
|
||||
except ValueError as ex:
|
||||
raise SqlmapSyntaxException("something went wrong during command line parsing ('%s')" % ex.message)
|
||||
|
||||
for i in xrange(len(argv)):
|
||||
@@ -866,7 +866,7 @@ def cmdLineParser(argv=None):
|
||||
|
||||
try:
|
||||
(args, _) = parser.parse_args(argv)
|
||||
except UnicodeEncodeError, ex:
|
||||
except UnicodeEncodeError as ex:
|
||||
dataToStdout("\n[!] %s\n" % ex.object.encode("unicode-escape"))
|
||||
raise SystemExit
|
||||
except SystemExit:
|
||||
|
||||
@@ -39,7 +39,7 @@ def configFileProxy(section, option, datatype):
|
||||
value = config.getfloat(section, option) if config.get(section, option) else 0.0
|
||||
else:
|
||||
value = config.get(section, option)
|
||||
except ValueError, ex:
|
||||
except ValueError as ex:
|
||||
errMsg = "error occurred while processing the option "
|
||||
errMsg += "'%s' in provided configuration file ('%s')" % (option, getUnicode(ex))
|
||||
raise SqlmapSyntaxException(errMsg)
|
||||
@@ -71,7 +71,7 @@ def configFileParser(configFile):
|
||||
try:
|
||||
config = UnicodeRawConfigParser()
|
||||
config.readfp(configFP)
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
errMsg = "you have provided an invalid and/or unreadable configuration file ('%s')" % getSafeExString(ex)
|
||||
raise SqlmapSyntaxException(errMsg)
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ def parseXmlNode(node):
|
||||
def loadBoundaries():
|
||||
try:
|
||||
doc = et.parse(paths.BOUNDARIES_XML)
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
errMsg = "something appears to be wrong with "
|
||||
errMsg += "the file '%s' ('%s'). Please make " % (paths.BOUNDARIES_XML, getSafeExString(ex))
|
||||
errMsg += "sure that you haven't made any changes to it"
|
||||
@@ -93,7 +93,7 @@ def loadPayloads():
|
||||
|
||||
try:
|
||||
doc = et.parse(payloadFilePath)
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
errMsg = "something appears to be wrong with "
|
||||
errMsg += "the file '%s' ('%s'). Please make " % (payloadFilePath, getSafeExString(ex))
|
||||
errMsg += "sure that you haven't made any changes to it"
|
||||
|
||||
Reference in New Issue
Block a user