Skip to content

Commit c1ce2c7

Browse files
committed
FIX: Do not fail _repr_html_ if keys are unorderable.
1 parent a1d60c7 commit c1ce2c7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cycler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,11 @@ def __repr__(self):
335335
def _repr_html_(self):
336336
# an table showing the value of each key through a full cycle
337337
output = "<table>"
338-
sorted_keys = sorted(self.keys)
338+
try:
339+
sorted_keys = sorted(self.keys)
340+
except TypeError:
341+
# We do not insist that the keys be sortable.
342+
sorted_keys = self.keys
339343
for key in sorted_keys:
340344
output += "<th>{key!r}</th>".format(key=key)
341345
for d in iter(self):

0 commit comments

Comments
 (0)