# HG changeset patch # User RĂ©mi Cardona # Date 1442591910 -7200 # Node ID ec0f96cd7a1871c63fa72f2923d5ac7d6c16abc5 # Parent f7227cbf1d185ea86297e50847a467681ca1cdbb [py3k] __unicode__ and __str__ diff -r f7227cbf1d18 -r ec0f96cd7a18 web/component.py --- a/web/component.py Mon Sep 21 19:00:26 2015 +0200 +++ b/web/component.py Fri Sep 18 17:58:30 2015 +0200 @@ -24,7 +24,7 @@ from warnings import warn -from six import add_metaclass +from six import PY3, add_metaclass, text_type from logilab.common.deprecation import class_deprecated, class_renamed, deprecated from logilab.mtconverter import xml_escape @@ -217,6 +217,9 @@ def __unicode__(self): return tags.a(self.label, href=self.href, **self.attrs) + if PY3: + __str__ = __unicode__ + def render(self, w): w(tags.a(self.label, href=self.href, **self.attrs))