mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-29 01:13:28 +03:00
another fix
This commit is contained in:
parent
a6a2e993cc
commit
3fe9f9cac9
|
@ -8,7 +8,6 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
||||||
class InterruptableThread(threading.Thread):
|
class InterruptableThread(threading.Thread):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
self.exceeded = False
|
|
||||||
self.result = None
|
self.result = None
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -21,8 +20,7 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
||||||
thread = InterruptableThread()
|
thread = InterruptableThread()
|
||||||
thread.start()
|
thread.start()
|
||||||
thread.join(duration)
|
thread.join(duration)
|
||||||
self.exceeded = thread.isAlive()
|
if thread.isAlive():
|
||||||
if self.exceeded:
|
|
||||||
return default
|
return default
|
||||||
else:
|
else:
|
||||||
return thread.result
|
return thread.result
|
||||||
|
|
Loading…
Reference in New Issue
Block a user