mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-16 19:40:37 +03:00
minor restyling
This commit is contained in:
parent
326ff404fc
commit
12d34587cc
|
@ -195,32 +195,31 @@ def cleanCase():
|
||||||
shutil.rmtree(paths.SQLMAP_OUTPUT_PATH, True)
|
shutil.rmtree(paths.SQLMAP_OUTPUT_PATH, True)
|
||||||
|
|
||||||
def runCase(switches=None, parse=None):
|
def runCase(switches=None, parse=None):
|
||||||
retVal = True
|
|
||||||
global failedItem
|
global failedItem
|
||||||
|
|
||||||
initCase(switches)
|
initCase(switches)
|
||||||
|
|
||||||
|
retVal = True
|
||||||
exception = None
|
exception = None
|
||||||
result = False
|
result = False
|
||||||
console = ""
|
console = ""
|
||||||
stdout = sys.stdout
|
|
||||||
LOGGER_HANDLER.stream = sys.stdout = StringIO.StringIO()
|
LOGGER_HANDLER.stream = sys.stdout = StringIO.StringIO()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = start()
|
result = start()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
except Exception, ex:
|
except Exception, e:
|
||||||
exception = ex
|
exception = e
|
||||||
finally:
|
finally:
|
||||||
sys.stdout.seek(0)
|
sys.stdout.seek(0)
|
||||||
console = sys.stdout.read()
|
console = sys.stdout.read()
|
||||||
LOGGER_HANDLER.stream = sys.stdout = stdout
|
LOGGER_HANDLER.stream = sys.stdout = sys.__stdout__
|
||||||
|
|
||||||
if exception:
|
if exception:
|
||||||
logger.error("unhandled exception occurred ('%s')" % str(exception))
|
logger.error("unhandled exception occurred ('%s')" % str(exception))
|
||||||
retVal = False
|
retVal = False
|
||||||
elif result == False: # if None, ignore
|
elif result is False: # if None, ignore
|
||||||
logger.error("the test did not run")
|
logger.error("the test did not run")
|
||||||
retVal = False
|
retVal = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user