diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-04-04 23:23:22 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-04-04 23:23:22 (GMT) |
commit | 76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419 (patch) | |
tree | e8ffdae0a844bc67100a04d2c539039263a4bc73 /Lib/dis.py | |
parent | 6f65d2dd1bd4d82029257ce3d1ea3ec4cbf44235 (diff) | |
download | cpython-76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419.zip cpython-76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419.tar.gz cpython-76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419.tar.bz2 |
fix dis on new style classes #8310
Diffstat (limited to 'Lib/dis.py')
-rw-r--r-- | Lib/dis.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -10,6 +10,9 @@ __all__ = ["dis", "disassemble", "distb", "disco", "findlinestarts", "findlabels"] + _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. @@ -29,10 +32,7 @@ def dis(x=None): items = x.__dict__.items() items.sort() for name, x1 in items: - if isinstance(x1, (types.MethodType, - types.FunctionType, - types.CodeType, - types.ClassType)): + if isinstance(x1, _have_code): print "Disassembly of %s:" % name try: dis(x1) |