]> granicus.if.org Git - python/commitdiff
- Fix conversion glitch in test_pyclbr, which caused a test to not fail
authorThomas Wouters <thomas@python.org>
Sat, 3 Feb 2007 21:49:06 +0000 (21:49 +0000)
committerThomas Wouters <thomas@python.org>
Sat, 3 Feb 2007 21:49:06 +0000 (21:49 +0000)
   when it should.

 - Remove unneeded classic-class support from pydoc (which would otherwise
   cause test_pyclbr to fail.)

Lib/pydoc.py
Lib/test/test_pyclbr.py

index dd10334c5ac41d3432945fa283174db98f704ed8..c496d1dd6ff6b47b5d915ed5e581d9f6747a537a 100755 (executable)
@@ -1448,9 +1448,6 @@ def locate(path, forceload=0):
 text = TextDoc()
 html = HTMLDoc()
 
-class _OldStyleClass: pass
-_OLD_INSTANCE_TYPE = type(_OldStyleClass())
-
 def resolve(thing, forceload=0):
     """Given an object or a path to an object, get the object and its name."""
     if isinstance(thing, str):
@@ -1471,10 +1468,6 @@ def doc(thing, title='Python Library Documentation: %s', forceload=0):
             desc += ' in ' + name[:name.rfind('.')]
         elif module and module is not object:
             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
                   inspect.isclass(object) or
                   inspect.isroutine(object) or
index 7c9d4aac0681ec42e0a7ac1b7c76eeef9419a8f5..a03daa9b4cd06957a0564cbde8128e848db84304 100644 (file)
@@ -44,7 +44,7 @@ class PyclbrTest(TestCase):
         if key in ignore: return
         if key not in obj:
             print >>sys.stderr, "***",key
-        self.failUnless(key) in obj
+        self.failUnless(key in obj)
 
     def assertEqualsOrIgnored(self, a, b, ignore):
         ''' succeed iff a == b or a in ignore or b in ignore '''