summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-04-04 23:23:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-04-04 23:23:22 (GMT)
commit76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419 (patch)
treee8ffdae0a844bc67100a04d2c539039263a4bc73 /Lib
parent6f65d2dd1bd4d82029257ce3d1ea3ec4cbf44235 (diff)
downloadcpython-76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419.zip
cpython-76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419.tar.gz
cpython-76a23c17bcd9e3f47cbddaf6a2032bd1d27e0419.tar.bz2
fix dis on new style classes #8310
Diffstat (limited to 'Lib')
-rw-r--r--Lib/dis.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index edc210f..5aa09c9 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -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)