mirror of https://github.com/python/cpython
(merge 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).
This commit is contained in:
commit
7348c6bbb6
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue