Ticket #5442: jython_isclass_workaround.patch

File jython_isclass_workaround.patch, 727 bytes (added by leo.soto@…, 17 years ago)

Workaround for the bug until it's fixed on jython

  • django/test/_doctest.py

     
    105105import warnings
    106106from StringIO import StringIO
    107107
     108# On Jython isclass() reports some modules as classes. Patch it:
     109def patch_isclass(isclass):
     110    def patched_isclass(obj):
     111        return isclass(obj) and hasattr(obj, '__module__')
     112    return patched_isclass
     113if sys.platform.startswith('java'):
     114    inspect.isclass = patch_isclass(inspect.isclass)
     115
     116
     117
    108118# Don't whine about the deprecated is_private function in this
    109119# module's tests.
    110120warnings.filterwarnings("ignore", "is_private", DeprecationWarning,
Back to Top