don't fail if CLOEXEC doesn't exist

This commit is contained in:
Benjamin Peterson 2011-12-27 16:52:20 -06:00
parent 83251c1ecd
commit 70069fcd4b

View File

@ -75,8 +75,9 @@ class TestEPoll(unittest.TestCase):
ep.close()
self.assertTrue(ep.closed)
self.assertRaises(ValueError, ep.fileno)
select.epoll(select.EPOLL_CLOEXEC).close()
self.assertRaises(OSError, select.epoll, flags=12356)
if hasattr(select, "EPOLL_CLOEXEC"):
select.epoll(select.EPOLL_CLOEXEC).close()
self.assertRaises(OSError, select.epoll, flags=12356)
def test_badcreate(self):
self.assertRaises(TypeError, select.epoll, 1, 2, 3)