3
# DP: Fix issue #8329: Don't return the same lists from select.select
4
# DP: when no fds are changed.
7
if [ $# -eq 3 -a "$2" = '-d' ]; then
10
elif [ $# -ne 1 ]; then
11
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
16
patch $pdir -f --no-backup-if-mismatch -p0 < $0
19
patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
22
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
27
Index: Lib/test/test_select.py
28
===================================================================
29
--- Lib/test/test_select.py (Revision 79866)
30
+++ Lib/test/test_select.py (Revision 79867)
32
self.assertRaises(TypeError, select.select, [self.Almost()], [], [])
33
self.assertRaises(TypeError, select.select, [], [], [], "not a number")
35
+ def test_returned_list_identity(self):
37
+ r, w, x = select.select([], [], [], 1)
38
+ self.assertIsNot(r, w)
39
+ self.assertIsNot(r, x)
40
+ self.assertIsNot(w, x)
42
def test_select(self):
43
cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
44
p = os.popen(cmd, 'r')
45
Index: Modules/selectmodule.c
46
===================================================================
47
--- Modules/selectmodule.c (Revision 79866)
48
+++ Modules/selectmodule.c (Revision 79867)
50
PyErr_SetFromErrno(SelectError);
55
- ifdlist = PyList_New(0);
57
- ret = PyTuple_Pack(3, ifdlist, ifdlist, ifdlist);
62
/* any of these three calls can raise an exception. it's more
63
convenient to test for this after all three calls... but