Commit 49be9ed9 authored by Gregory P. Smith's avatar Gregory P. Smith

Fix unchecked select.poll reference in setUp and tearDown for

platforms that don't have it.
parents 2a86b253 ac14aa51
......@@ -169,12 +169,14 @@ def test_telnet(reads=(), cls=TelnetAlike, use_poll=None):
class ExpectAndReadTestCase(TestCase):
def setUp(self):
self.old_select = select.select
self.old_poll = select.poll
select.select = mock_select
if hasattr(select, 'poll'):
self.old_poll = select.poll
select.poll = MockPoller
MockPoller.test_case = self
def tearDown(self):
if hasattr(select, 'poll'):
MockPoller.test_case = None
select.poll = self.old_poll
select.select = self.old_select
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment