diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-07-16 20:39:10 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-07-16 20:39:10 (GMT) |
commit | 49be9ed9765f30aac0d9757f9f809ac9706e5eb8 (patch) | |
tree | 3a27577bcf8bed76b835dac5494974d3b1715f70 /Lib/test/test_telnetlib.py | |
parent | 2a86b25323531397c4ffcb8ed5920b56d5ebb10e (diff) | |
parent | ac14aa51876203be01ac4d62dec53c96dd1883c9 (diff) | |
download | cpython-49be9ed9765f30aac0d9757f9f809ac9706e5eb8.zip cpython-49be9ed9765f30aac0d9757f9f809ac9706e5eb8.tar.gz cpython-49be9ed9765f30aac0d9757f9f809ac9706e5eb8.tar.bz2 |
Fix unchecked select.poll reference in setUp and tearDown for
platforms that don't have it.
Diffstat (limited to 'Lib/test/test_telnetlib.py')
-rw-r--r-- | Lib/test/test_telnetlib.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py index b7c0052..c8da421 100644 --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -169,14 +169,16 @@ 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 - select.poll = MockPoller - MockPoller.test_case = self + if hasattr(select, 'poll'): + self.old_poll = select.poll + select.poll = MockPoller + MockPoller.test_case = self def tearDown(self): - MockPoller.test_case = None - select.poll = self.old_poll + if hasattr(select, 'poll'): + MockPoller.test_case = None + select.poll = self.old_poll select.select = self.old_select |