Django

Code

Changeset 6194

Show
Ignore:
Timestamp:
09/14/07 12:17:37 (1 year ago)
Author:
adrian
Message:

Fixed #5442 -- Added Jython workaround in django.test._doctest. Thanks, leo.soto@gmail.com

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/test/_doctest.py

    r5391 r6194  
    11# This is a slightly modified version of the doctest.py that shipped with Python 2.4 
    2 # It incorporates changes that have been submitted the the Python ticket tracker  
     2# It incorporates changes that have been submitted the the Python ticket tracker 
    33# as ticket #1521051. These changes allow for a DoctestRunner and Doctest base 
    44# class to be specified when constructing a DoctestSuite. 
     
    106106from StringIO import StringIO 
    107107 
     108if sys.platform.startswith('java'): 
     109    # On Jython, isclass() reports some modules as classes. Patch it. 
     110    def patch_isclass(isclass): 
     111        def patched_isclass(obj): 
     112            return isclass(obj) and hasattr(obj, '__module__') 
     113        return patched_isclass 
     114    inspect.isclass = patch_isclass(inspect.isclass) 
     115 
    108116# Don't whine about the deprecated is_private function in this 
    109117# module's tests.