Skip to content

Commit

Permalink
[fix] forgot to port a function to bytestrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycojoker committed Feb 1, 2016
1 parent 48b6d78 commit da60473
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions redbaron.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,19 @@ def __str__(self):
def _bytes_repr_html_(self):
def __repr_html(self):
# string addition is slow (and makes copies)
yield u"<table>"
yield u"<tr><th>Index</th><th>node</th></tr>"
yield b"<table>"
yield b"<tr><th>Index</th><th>node</th></tr>"
for num, item in enumerate(self):
yield u"<tr>"
yield u"<td>"
yield str(num)
yield u"</td>"
yield u"<td>"
yield item._repr_html_() if hasattr(item, "_repr_html_") else str(item)
yield u"</td>"
yield u"</tr>"
yield "</table>"
return u''.join(__repr_html(self))
yield b"<tr>"
yield b"<td>"
yield str(num).encode("Utf-8")
yield b"</td>"
yield b"<td>"
yield item._bytes_repr_html_() if hasattr(item, "_repr_html_") else str(item)
yield b"</td>"
yield b"</tr>"
yield b"</table>"
return b''.join(__repr_html(self))

def _repr_html_(self):
return self._bytes_repr_html_().decode("Utf-8")
Expand Down

0 comments on commit da60473

Please sign in to comment.