Skip to content
Snippets Groups Projects
Commit efc40990 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Use six unichr() in string_histogram()

parent 4c66632d
No related branches found
No related tags found
No related merge requests found
...@@ -1393,9 +1393,9 @@ def string_histogram(iterable, min_value=None, max_value=None, ...@@ -1393,9 +1393,9 @@ def string_histogram(iterable, min_value=None, max_value=None,
full = int(floor(scaled)) full = int(floor(scaled))
eighths = int(ceil((scaled-full)*8)) eighths = int(ceil((scaled-full)*8))
if eighths: if eighths:
return full*unichr(0x2588) + unichr(0x2588+(8-eighths)) return full*six.unichr(0x2588) + six.unichr(0x2588+(8-eighths))
else: else:
return full*unichr(0x2588) return full*six.unichr(0x2588)
else: else:
def format_bar(cnt): def format_bar(cnt):
return int(ceil(cnt*width/max_count))*"#" return int(ceil(cnt*width/max_count))*"#"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment