diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py index 9cb0a85166f..5c9f7c9ceaf 100644 --- a/Lib/test/test_kqueue.py +++ b/Lib/test/test_kqueue.py @@ -23,7 +23,10 @@ class TestKQueue(unittest.TestCase): def test_create_event(self): from operator import lt, le, gt, ge - fd = sys.stderr.fileno() + + fd = os.open(os.devnull, os.O_WRONLY) + self.addCleanup(os.close, fd) + ev = select.kevent(fd) other = select.kevent(1000) self.assertEqual(ev.ident, fd)