mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
Minor refactoring
This commit is contained in:
@@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
import threading
|
||||
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import CUSTOM_LOGGING
|
||||
|
||||
def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
||||
class InterruptableThread(threading.Thread):
|
||||
@@ -19,7 +20,7 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
||||
try:
|
||||
self.result = func(*args, **kwargs)
|
||||
except Exception, msg:
|
||||
logger.log(7, msg)
|
||||
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, msg)
|
||||
self.result = default
|
||||
|
||||
thread = InterruptableThread()
|
||||
|
||||
Reference in New Issue
Block a user