From 12d34587ccd90d11bdb5dea1e56710cd9fd7cb06 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Wed, 19 Dec 2012 14:34:34 +0000 Subject: [PATCH] minor restyling --- lib/core/testing.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/core/testing.py b/lib/core/testing.py index bb11d1184..da7f0f29c 100644 --- a/lib/core/testing.py +++ b/lib/core/testing.py @@ -195,32 +195,31 @@ def cleanCase(): shutil.rmtree(paths.SQLMAP_OUTPUT_PATH, True) def runCase(switches=None, parse=None): - retVal = True global failedItem initCase(switches) + retVal = True exception = None result = False console = "" - stdout = sys.stdout LOGGER_HANDLER.stream = sys.stdout = StringIO.StringIO() try: result = start() except KeyboardInterrupt: raise - except Exception, ex: - exception = ex + except Exception, e: + exception = e finally: sys.stdout.seek(0) console = sys.stdout.read() - LOGGER_HANDLER.stream = sys.stdout = stdout + LOGGER_HANDLER.stream = sys.stdout = sys.__stdout__ if exception: logger.error("unhandled exception occurred ('%s')" % str(exception)) retVal = False - elif result == False: # if None, ignore + elif result is False: # if None, ignore logger.error("the test did not run") retVal = False