Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_kqueue.py @ 71066:74c6afbb524a 3.2
Issue #12400: don't use sys.stderr in test_kqueue because it may be replaced by
a io.StringIO object by regrtest (which has no file descriptor).
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Wed, 29 Jun 2011 14:59:10 +0200 |
| parents | 3c9232a684ae |
| children | fdb98a7ef9be |
line wrap: on
line diff
--- a/Lib/test/test_kqueue.py Wed Jun 29 13:24:28 2011 +0200 +++ b/Lib/test/test_kqueue.py Wed Jun 29 14:59:10 2011 +0200 @@ -23,7 +23,10 @@ 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)
