[Python-checkins] cpython: don't fail if CLOEXEC doesn't exist

benjamin.peterson python-checkins at python.org
Tue Dec 27 23:52:31 CET 2011


http://hg.python.org/cpython/rev/456b02030100
changeset:   74189:456b02030100
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Dec 27 16:52:20 2011 -0600
summary:
  don't fail if CLOEXEC doesn't exist

files:
  Lib/test/test_epoll.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py
--- a/Lib/test/test_epoll.py
+++ b/Lib/test/test_epoll.py
@@ -75,8 +75,9 @@
         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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list