- Fix conversion glitch in test_pyclbr, which caused a test to not fail

when it should.

 - Remove unneeded classic-class support from pydoc (which would otherwise
   cause test_pyclbr to fail.)
This commit is contained in:
Thomas Wouters 2007-02-03 21:49:06 +00:00
parent b213704f3c
commit 08f00467b9
2 changed files with 1 additions and 8 deletions

View File

@ -1448,9 +1448,6 @@ def locate(path, forceload=0):
text = TextDoc() text = TextDoc()
html = HTMLDoc() html = HTMLDoc()
class _OldStyleClass: pass
_OLD_INSTANCE_TYPE = type(_OldStyleClass())
def resolve(thing, forceload=0): def resolve(thing, forceload=0):
"""Given an object or a path to an object, get the object and its name.""" """Given an object or a path to an object, get the object and its name."""
if isinstance(thing, str): if isinstance(thing, str):
@ -1471,10 +1468,6 @@ def doc(thing, title='Python Library Documentation: %s', forceload=0):
desc += ' in ' + name[:name.rfind('.')] desc += ' in ' + name[:name.rfind('.')]
elif module and module is not object: elif module and module is not object:
desc += ' in module ' + module.__name__ desc += ' in module ' + module.__name__
if type(object) is _OLD_INSTANCE_TYPE:
# If the passed object is an instance of an old-style class,
# document its available methods instead of its value.
object = object.__class__
elif not (inspect.ismodule(object) or elif not (inspect.ismodule(object) or
inspect.isclass(object) or inspect.isclass(object) or
inspect.isroutine(object) or inspect.isroutine(object) or

View File

@ -44,7 +44,7 @@ class PyclbrTest(TestCase):
if key in ignore: return if key in ignore: return
if key not in obj: if key not in obj:
print >>sys.stderr, "***",key print >>sys.stderr, "***",key
self.failUnless(key) in obj self.failUnless(key in obj)
def assertEqualsOrIgnored(self, a, b, ignore): def assertEqualsOrIgnored(self, a, b, ignore):
''' succeed iff a == b or a in ignore or b in ignore ''' ''' succeed iff a == b or a in ignore or b in ignore '''