diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py index de8299eec36..7f9547ff959 100644 --- a/Lib/test/test_epoll.py +++ b/Lib/test/test_epoll.py @@ -75,8 +75,9 @@ def test_create(self): 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)