summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-02-20 14:47:14 -0800
committerJeff Forcier <jeff@bitprophet.org>2017-02-20 14:47:14 -0800
commitc28f97708e519a2522a349132fe7650e33e2b4dc (patch)
treed72bb033112b06a4c38364089f571a1610dbb2ec
parenta16a28afbf643b1219796f041edde05109fa2000 (diff)
parent168b8b383efc894cfa8d81946e524a639326f413 (diff)
Merge branch '2.0' into 2.1
-rw-r--r--sites/www/changelog.rst3
-rw-r--r--tests/test_packetizer.py8
2 files changed, 9 insertions, 2 deletions
diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst
index b53f0828..957bf5ef 100644
--- a/sites/www/changelog.rst
+++ b/sites/www/changelog.rst
@@ -2,6 +2,9 @@
Changelog
=========
+* :bug:`862 (1.17+)` (via :issue:`863`) Avoid test suite exceptions on
+ platforms lacking ``errno.ETIME`` (which seems to be some FreeBSD and some
+ Windows environments.) Thanks to Sofian Brabez.
* :bug:`44 (1.17+)` (via :issue:`891`) `SSHClient <paramiko.client.SSHClient>`
now gives its internal `Transport <paramiko.transport.Transport>` a handle on
itself, preventing garbage collection of the client until the session is
diff --git a/tests/test_packetizer.py b/tests/test_packetizer.py
index a1ea398c..02173292 100644
--- a/tests/test_packetizer.py
+++ b/tests/test_packetizer.py
@@ -114,9 +114,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)