Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #5442 -- Added Jython workaround in django.test._doctest. Thank…

…s, leo.soto@gmail.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 933cda3749865b0c776a21b39076c500ddcbe12f 1 parent 42f4f44
Adrian Holovaty authored

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. 10  django/test/_doctest.py
10  django/test/_doctest.py
... ...
@@ -1,5 +1,5 @@
1 1
 # 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
3 3
 # as ticket #1521051. These changes allow for a DoctestRunner and Doctest base
4 4
 # class to be specified when constructing a DoctestSuite.
5 5
 
@@ -105,6 +105,14 @@ def _test():
105 105
 import warnings
106 106
 from StringIO import StringIO
107 107
 
  108
+if 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
+
108 116
 # Don't whine about the deprecated is_private function in this
109 117
 # module's tests.
110 118
 warnings.filterwarnings("ignore", "is_private", DeprecationWarning,

0 notes on commit 933cda3

Please sign in to comment.
Something went wrong with that request. Please try again.