def ensure_utf8(image_tag):
if py3compat.PY3:<EOL><INDENT>return image_tag<EOL><DEDENT>def utf8_image_tag(*args, **kwargs):<EOL><INDENT>s = image_tag(*args, **kwargs)<EOL>if isinstance(s, str):<EOL><INDENT>s = s.encode('<STR_LIT:utf8>')<EOL><DEDENT>return s<EOL><DEDENT>return utf8_image_tag<EOL>
wrapper for ensuring image_tag returns utf8-encoded str on Python 2