~pythoneers/ubuntu/lucid/python2.6/ltsppa

« back to all changes in this revision

Viewing changes to debian/patches/issue8310.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 #8310: Allow dis to examine new style classes.
 
4
 
 
5
dir=
 
6
if [ $# -eq 3 -a "$2" = '-d' ]; then
 
7
    pdir="-d $3"
 
8
    dir="$3/"
 
9
elif [ $# -ne 1 ]; then
 
10
    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
11
    exit 1
 
12
fi
 
13
case "$1" in
 
14
    -patch)
 
15
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
 
16
        ;;
 
17
    -unpatch)
 
18
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
 
19
        ;;
 
20
    *)
 
21
        echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
22
        exit 1
 
23
esac
 
24
exit 0
 
25
 
 
26
Index: Lib/dis.py
 
27
===================================================================
 
28
--- Lib/dis.py  (Revision 79768)
 
29
+++ Lib/dis.py  (Revision 79769)
 
30
@@ -10,6 +10,9 @@
 
31
            "findlinestarts", "findlabels"] + _opcodes_all
 
32
 del _opcodes_all
 
33
 
 
34
+_have_code = (types.MethodType, types.FunctionType, types.CodeType,
 
35
+              types.ClassType, type)
 
36
+
 
37
 def dis(x=None):
 
38
     """Disassemble classes, methods, functions, or code.
 
39
 
 
40
@@ -29,10 +32,7 @@
 
41
         items = x.__dict__.items()
 
42
         items.sort()
 
43
         for name, x1 in items:
 
44
-            if isinstance(x1, (types.MethodType,
 
45
-                               types.FunctionType,
 
46
-                               types.CodeType,
 
47
-                               types.ClassType)):
 
48
+            if isinstance(x1, _have_code):
 
49
                 print "Disassembly of %s:" % name
 
50
                 try:
 
51
                     dis(x1)