From: Benjamin Peterson Date: Tue, 27 Dec 2011 22:52:20 +0000 (-0600) Subject: don't fail if CLOEXEC doesn't exist X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70069fcd4b327eb4a6d91a27db7a423e71711b97;p=python don't fail if CLOEXEC doesn't exist --- diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py index de8299eec3..7f9547ff95 100644 --- a/Lib/test/test_epoll.py +++ b/Lib/test/test_epoll.py @@ -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)