v2ex/babel/ext/bleach/__init__.py
def _render(tree):
    """Try rendering as HTML, then XML, then give up."""
    try:
        return force_unicode(_serialize(tree))
    except Exception, e:
        log.error('HTML: %r' % e, exc_info=sys.exc_info())
        try:
            return force_unicode(tree.toxml())
        except Exception, e:
            log.error('XML: %r' % e, exc_info=sys.exc_info())
            return u''
Try rendering as HTML, then XML, then give up.
Try rendering as HTML, then XML, then give up.
Try rendering as HTML then XML then give up .
def _render(tree):
    try:
        return force_unicode(_serialize(tree))
    except Exception, e:
        log.error('HTML: %r' % e, exc_info=sys.exc_info())
        try:
            return force_unicode(tree.toxml())
        except Exception, e:
            log.error('XML: %r' % e, exc_info=sys.exc_info())
            return u''
def _render ( tree ) : try : return force_unicode ( _serialize ( tree ) ) except Exception , e : log . error ( 'HTML: %r' % e , exc_info = sys . exc_info ( ) ) try : return force_unicode ( tree . toxml ( ) ) except Exception , e : log . error ( 'XML: %r' % e , exc_info = sys . exc_info ( ) ) return u''
Try rendering as HTML, then XML, then give up.
Try rendering as HTML then XML then give up .
"""Try rendering as HTML, then XML, then give up."""
tree