From 089172fe0c5b71d4e781655dd9cb8fbd31233e11 Mon Sep 17 00:00:00 2001 From: Tim Savannah Date: Mon, 13 May 2019 11:07:33 -0400 Subject: [PATCH] Be explicit that StoppableThread.stop #exception argument needs to be a class/type, not an instance. --- func_timeout/StoppableThread.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/func_timeout/StoppableThread.py b/func_timeout/StoppableThread.py index 35fdab2..0b12412 100644 --- a/func_timeout/StoppableThread.py +++ b/func_timeout/StoppableThread.py @@ -56,8 +56,10 @@ class StoppableThread(threading.Thread): ''' Stops the thread by raising a given exception. - @param exception - Exception to throw. Likely, you want to use something + @param exception - Exception to throw. Likely, you want to use something that inherits from BaseException (so except Exception as e: continue; isn't a problem) + + This should be a class/type, NOT an instance, i.e. MyExceptionType not MyExceptionType() ''' return self._stopThread(exception, raiseEvery)