NiceSort is invoked on arrays that may contain strings, but in other
situations can contain ints as well. As this surprisingly makes sense,
add a tiny modification to make NiceSort work in these conditions.
Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>
"""
return [_NiceSortTryInt(grp)
- for grp in _SORTER_RE.match(value).groups()]
+ for grp in _SORTER_RE.match(str(value)).groups()]
def NiceSort(values, key=None):