summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-06-29 12:59:10 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-06-29 12:59:10 (GMT)
commit46b209114655d1decbee42062102f47da63b2afe (patch)
tree6ed81e413e93ab4a66527ec94e4fa110573e4dd0
parentbd98f9367c4843fb6b843b7383327870e144fb61 (diff)
downloadcpython-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.py5
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)