FunctionTimedOut inherits TimeoutError
This commit is contained in:
parent
50baa8db50
commit
7531c64f9b
@ -1,3 +1,6 @@
|
||||
* 4.3.6 - unreleased
|
||||
|
||||
- FunctionTimedOut inherits TimeoutError instead of BaseException
|
||||
|
||||
* 4.3.5 - Aug 19 2019
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ This is the function wherein you pass the timeout, the function you want to call
|
||||
**Example**
|
||||
|
||||
|
||||
So, for esxample, if you have a function "doit('arg1', 'arg2')" that you want to limit to running for 5 seconds, with func\_timeout you can call it like this:
|
||||
So, for example, if you have a function "doit('arg1', 'arg2')" that you want to limit to running for 5 seconds, with func\_timeout you can call it like this:
|
||||
|
||||
|
||||
from func_timeout import func_timeout, FunctionTimedOut
|
||||
|
||||
@ -39,7 +39,7 @@ This is the function wherein you pass the timeout, the function you want to call
|
||||
**Example**
|
||||
|
||||
|
||||
So, for esxample, if you have a function "doit('arg1', 'arg2')" that you want to limit to running for 5 seconds, with func\_timeout you can call it like this:
|
||||
So, for example, if you have a function "doit('arg1', 'arg2')" that you want to limit to running for 5 seconds, with func\_timeout you can call it like this:
|
||||
|
||||
|
||||
from func\_timeout import func\_timeout, FunctionTimedOut
|
||||
|
||||
@ -9,7 +9,7 @@ __all__ = ('FunctionTimedOut', 'RETRY_SAME_TIMEOUT')
|
||||
|
||||
RETRY_SAME_TIMEOUT = 'RETRY_SAME_TIMEOUT'
|
||||
|
||||
class FunctionTimedOut(BaseException):
|
||||
class FunctionTimedOut(TimeoutError):
|
||||
'''
|
||||
FunctionTimedOut - Exception raised when a function times out
|
||||
|
||||
@ -51,7 +51,7 @@ class FunctionTimedOut(BaseException):
|
||||
if not msg:
|
||||
msg = self.getMsg()
|
||||
|
||||
BaseException.__init__(self, msg)
|
||||
TimeoutError.__init__(self, msg)
|
||||
|
||||
self.msg = msg
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user