~ubuntu-branches/ubuntu/lucid/python2.6/lucid-security

« back to all changes in this revision

Viewing changes to debian/patches/issue8329.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-04-15 01:21:07 UTC
  • Revision ID: james.westby@ubuntu.com-20100415012107-xw3c5xt5von7zrgi
Tags: 2.6.5-1ubuntu5
* Fix issue #8329: Don't return the same lists from select.select
  when no fds are changed.
* Fix issue #8310: Allow dis to examine new style classes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
 
 
3
# DP: Fix issue #8329: Don't return the same lists from select.select
 
4
# DP: when no fds are changed.
 
5
 
 
6
dir=
 
7
if [ $# -eq 3 -a "$2" = '-d' ]; then
 
8
    pdir="-d $3"
 
9
    dir="$3/"
 
10
elif [ $# -ne 1 ]; then
 
11
    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
12
    exit 1
 
13
fi
 
14
case "$1" in
 
15
    -patch)
 
16
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
 
17
        ;;
 
18
    -unpatch)
 
19
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
 
20
        ;;
 
21
    *)
 
22
        echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
23
        exit 1
 
24
esac
 
25
exit 0
 
26
 
 
27
Index: Lib/test/test_select.py
 
28
===================================================================
 
29
--- Lib/test/test_select.py     (Revision 79866)
 
30
+++ Lib/test/test_select.py     (Revision 79867)
 
31
@@ -21,6 +21,13 @@
 
32
         self.assertRaises(TypeError, select.select, [self.Almost()], [], [])
 
33
         self.assertRaises(TypeError, select.select, [], [], [], "not a number")
 
34
 
 
35
+    def test_returned_list_identity(self):
 
36
+        # See issue #8329
 
37
+        r, w, x = select.select([], [], [], 1)
 
38
+        self.assertIsNot(r, w)
 
39
+        self.assertIsNot(r, x)
 
40
+        self.assertIsNot(w, x)
 
41
+
 
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)
 
49
@@ -287,14 +287,6 @@
 
50
                PyErr_SetFromErrno(SelectError);
 
51
        }
 
52
 #endif
 
53
-       else if (n == 0) {
 
54
-                /* optimization */
 
55
-               ifdlist = PyList_New(0);
 
56
-               if (ifdlist) {
 
57
-                       ret = PyTuple_Pack(3, ifdlist, ifdlist, ifdlist);
 
58
-                       Py_DECREF(ifdlist);
 
59
-               }
 
60
-       }
 
61
        else {
 
62
                /* any of these three calls can raise an exception.  it's more
 
63
                   convenient to test for this after all three calls... but