mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
minor update
This commit is contained in:
parent
c303feab17
commit
a6a2e993cc
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
from lib.core.data import logger
|
||||||
|
|
||||||
def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
||||||
class InterruptableThread(threading.Thread):
|
class InterruptableThread(threading.Thread):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -12,7 +14,8 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
self.result = func(*args, **kwargs)
|
self.result = func(*args, **kwargs)
|
||||||
except:
|
except Exception, msg:
|
||||||
|
logger.log(8, msg)
|
||||||
self.result = default
|
self.result = default
|
||||||
|
|
||||||
thread = InterruptableThread()
|
thread = InterruptableThread()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user