diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-04-04 23:27:35 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-04-04 23:27:35 (GMT) |
commit | 51e7ad3b04b02df782dffc462f59bc82a530654b (patch) | |
tree | 772d27b17bab70fb5abf63d95b685ccae08d4464 /Lib | |
parent | 3482370d8b61126f6d29930901da3ce39d694db2 (diff) | |
download | cpython-51e7ad3b04b02df782dffc462f59bc82a530654b.zip cpython-51e7ad3b04b02df782dffc462f59bc82a530654b.tar.gz cpython-51e7ad3b04b02df782dffc462f59bc82a530654b.tar.bz2 |
Merged revisions 79769 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79769 | benjamin.peterson | 2010-04-04 18:23:22 -0500 (Sun, 04 Apr 2010) | 1 line
fix dis on new style classes #8310
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/dis.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -9,6 +9,9 @@ from opcode import __all__ as _opcodes_all __all__ = ["dis","disassemble","distb","disco"] + _opcodes_all del _opcodes_all +_have_code = (types.MethodType, types.FunctionType, types.CodeType, + types.ClassType, type) + def dis(x=None): """Disassemble classes, methods, functions, or code. @@ -28,10 +31,7 @@ def dis(x=None): items = x.__dict__.items() items.sort() for name, x1 in items: - if type(x1) in (types.MethodType, - types.FunctionType, - types.CodeType, - types.ClassType): + if isinstance(x1, _have_code): print "Disassembly of %s:" % name try: dis(x1) |