Skip to content

Commit

Permalink
Fix doctests with Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed May 12, 2015
1 parent 206b777 commit 4656f78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyuca/utils.py
Expand Up @@ -23,14 +23,14 @@ def int2hexstrings(number_list):
>>> int2hexstrings([0, 1, 65535])
['0000', '0001', 'FFFF']
"""
return ["{:04X}".format(n) for n in number_list]
return [str("{:04X}".format(n)) for n in number_list]


def format_collation_elements(collation_elements):
"""
format collation element array (list of list of integer weights)
>>> format_collation_elements([[1, 2, 3], [4, 5]])
>>> str(format_collation_elements([[1, 2, 3], [4, 5]]))
'[0001.0002.0003], [0004.0005]'
>>> format_collation_elements(None)
"""
Expand All @@ -47,7 +47,7 @@ def format_collation_elements(collation_elements):
def format_sort_key(sort_key):
"""
format sort key (list of integers) with | level boundaries
>>> format_sort_key([1, 0, 65535])
>>> str(format_sort_key([1, 0, 65535]))
'0001 | FFFF'
"""
return " ".join(
Expand Down

0 comments on commit 4656f78

Please sign in to comment.