Ticket #5442: jython_isclass_workaround.patch
File jython_isclass_workaround.patch, 727 bytes (added by , 17 years ago) |
---|
-
django/test/_doctest.py
105 105 import warnings 106 106 from StringIO import StringIO 107 107 108 # On Jython isclass() reports some modules as classes. Patch it: 109 def patch_isclass(isclass): 110 def patched_isclass(obj): 111 return isclass(obj) and hasattr(obj, '__module__') 112 return patched_isclass 113 if sys.platform.startswith('java'): 114 inspect.isclass = patch_isclass(inspect.isclass) 115 116 117 108 118 # Don't whine about the deprecated is_private function in this 109 119 # module's tests. 110 120 warnings.filterwarnings("ignore", "is_private", DeprecationWarning,