diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-02-20 14:46:53 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-02-20 14:46:53 -0800 |
commit | f7bb33a55de43c73098c14a2b4d66489870008c7 (patch) | |
tree | 14b6a11bf540781f6b92854f3db122d0cf9315a8 /tests/test_packetizer.py | |
parent | 37978cc748bd40e5ea4caa747692ff4a0ab82f2c (diff) | |
parent | d09ca08d628ade6e04d708a6b7010801eeda4503 (diff) |
Merge branch '1.17' into 1.18
Diffstat (limited to 'tests/test_packetizer.py')
-rw-r--r-- | tests/test_packetizer.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_packetizer.py b/tests/test_packetizer.py index 15a7c93f..a7cac6de 100644 --- a/tests/test_packetizer.py +++ b/tests/test_packetizer.py @@ -101,9 +101,13 @@ class PacketizerTest (unittest.TestCase): import signal class TimeoutError(Exception): - pass + def __init__(self, error_message): + if hasattr(errno, 'ETIME'): + self.message = os.sterror(errno.ETIME) + else: + self.messaage = error_message - def timeout(seconds=1, error_message=os.strerror(errno.ETIME)): + def timeout(seconds=1, error_message='Timer expired'): def decorator(func): def _handle_timeout(signum, frame): raise TimeoutError(error_message) |