Permalink
Browse files

Modify handle_timeout to support **kwargs

  • Loading branch information...
1 parent 79d6e08 commit 6cfa691fe55c8e8683680dd5f78ac764f6aa88b2 @ehrmann ehrmann committed Feb 21, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 r2/r2/lib/utils/utils.py
View
@@ -967,12 +967,12 @@ def __init__(self, function, timeout):
def handle_timeout(self, signum, frame):
raise TimeoutFunctionException()
- def __call__(self, *args):
+ def __call__(self, *args, **kwargs):
# can only be called from the main thread
old = signal.signal(signal.SIGALRM, self.handle_timeout)
signal.alarm(self.timeout)
try:
- result = self.function(*args)
+ result = self.function(*args, **kwargs)
finally:
signal.alarm(0)
signal.signal(signal.SIGALRM, old)

0 comments on commit 6cfa691

Please sign in to comment.