mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +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):
|
||||
def __init__(self):
|
||||
threading.Thread.__init__(self)
|
||||
self.exceeded = False
|
||||
self.result = None
|
||||
|
||||
def run(self):
|
||||
|
@ -21,8 +20,7 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
|||
thread = InterruptableThread()
|
||||
thread.start()
|
||||
thread.join(duration)
|
||||
self.exceeded = thread.isAlive()
|
||||
if self.exceeded:
|
||||
if thread.isAlive():
|
||||
return default
|
||||
else:
|
||||
return thread.result
|
||||
|
|
Loading…
Reference in New Issue
Block a user