From e59a22019983e01c241a85fc7414df371614c270 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 8 Sep 2015 11:10:47 +0200 Subject: [PATCH] Fixes #1393 --- lib/core/threads.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/core/threads.py b/lib/core/threads.py index 7a1f8d0f3..ec43ecd0d 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -10,7 +10,7 @@ import threading import time import traceback -from thread import error as threadError +from thread import error as ThreadError from lib.core.data import conf from lib.core.data import kb @@ -89,9 +89,9 @@ def exceptionHandledFunction(threadFunction): kb.threadContinue = False kb.threadException = True raise - except Exception, errMsg: + except Exception, ex: # thread is just going to be silently killed - logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg)) + logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message)) def setDaemon(thread): # Reference: http://stackoverflow.com/questions/190010/daemon-threads-explanation @@ -145,8 +145,8 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio try: thread.start() - except threadError, errMsg: - errMsg = "error occurred while starting new thread ('%s')" % errMsg + except ThreadError, ex: + errMsg = "error occurred while starting new thread ('%s')" % ex.message logger.critical(errMsg) break @@ -178,10 +178,10 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio if forwardException: raise - except (SqlmapConnectionException, SqlmapValueException), errMsg: + except (SqlmapConnectionException, SqlmapValueException), ex: print kb.threadException = True - logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg)) + logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message)) except: from lib.core.common import unhandledExceptionMessage