diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-29 12:59:10 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-29 12:59:10 (GMT) |
commit | 46b209114655d1decbee42062102f47da63b2afe (patch) | |
tree | 6ed81e413e93ab4a66527ec94e4fa110573e4dd0 | |
parent | bd98f9367c4843fb6b843b7383327870e144fb61 (diff) | |
download | cpython-46b209114655d1decbee42062102f47da63b2afe.zip cpython-46b209114655d1decbee42062102f47da63b2afe.tar.gz cpython-46b209114655d1decbee42062102f47da63b2afe.tar.bz2 |
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).
-rw-r--r-- | Lib/test/test_kqueue.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py index 9cb0a85..5c9f7c9 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) |