diff --git a/zerver/lib/timeout.py b/zerver/lib/timeout.py index 3da3e9e409..285ced1b7c 100644 --- a/zerver/lib/timeout.py +++ b/zerver/lib/timeout.py @@ -4,6 +4,7 @@ import sys import time import ctypes import threading +import six # Based on http://code.activestate.com/recipes/483752/ @@ -79,5 +80,5 @@ def timeout(timeout, func, *args, **kwargs): if thread.exc_info: # Raise the original stack trace so our error messages are more useful. # from http://stackoverflow.com/a/4785766/90777 - raise thread.exc_info[0], thread.exc_info[1], thread.exc_info[2] + six.reraise(thread.exc_info[0], thread.exc_info[1], thread.exc_info[2]) return thread.result