Browse files

FIX: help for old-style classes

  • Loading branch information...
1 parent 4931cbd commit 9e908a9f09e0475dbe4a1d59e2cd8dd44ccfcee4 @christianbrodbeck committed Aug 25, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 eelbrain/wxterm/help.py
View
9 eelbrain/wxterm/help.py
@@ -404,14 +404,17 @@ def parse_object(self, obj):
subtitle = "Method of %s" % str(type(obj.__self__))[1:-1]
intro = doc2html(obj) + '<br>'
elif isinstance(obj, types.ObjectType):
- if isinstance(obj, types.TypeType):
+ if isinstance(obj, (types.TypeType, types.ClassType)):
+ # ClassType: old-style classes (?)
title = "%s" % obj.__name__
+ module = obj.__module__
else:
title = "%s" % obj.__class__.__name__
- if obj.__class__.__module__ == '__builtin__':
+ module = obj.__class__.__module__
+ if module == '__builtin__':
subtitle = "builtin class"
else:
- subtitle = "class in %s" % obj.__class__.__module__
+ subtitle = "class in %s" % module
intro = '<br>'.join((doc2html(obj),
"<h2>Initialization</h2>",
# format_subtitle("(...)"),

0 comments on commit 9e908a9

Please sign in to comment.