mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
Minor refactoring
This commit is contained in:
parent
fbaeecdaf9
commit
75e6d77fbc
3 changed files with 7 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue