[Python-3000-checkins] r53627 - in python/branches/p3yk/Lib: pydoc.py test/test_pyclbr.py

thomas.wouters python-3000-checkins at python.org
Sat Feb 3 22:49:08 CET 2007


Author: thomas.wouters
Date: Sat Feb  3 22:49:06 2007
New Revision: 53627

Modified:
   python/branches/p3yk/Lib/pydoc.py
   python/branches/p3yk/Lib/test/test_pyclbr.py
Log:

 - 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.)



Modified: python/branches/p3yk/Lib/pydoc.py
==============================================================================
--- python/branches/p3yk/Lib/pydoc.py	(original)
+++ python/branches/p3yk/Lib/pydoc.py	Sat Feb  3 22:49:06 2007
@@ -1448,9 +1448,6 @@
 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 @@
             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

Modified: python/branches/p3yk/Lib/test/test_pyclbr.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_pyclbr.py	(original)
+++ python/branches/p3yk/Lib/test/test_pyclbr.py	Sat Feb  3 22:49:06 2007
@@ -44,7 +44,7 @@
         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 '''


More information about the Python-3000-checkins mailing list