Allow natural sort to accept non-strings.

This commit is contained in:
Bob Lantz
2014-10-28 16:06:53 -07:00
parent 89fb081983
commit 94f088d7e8
+1 -1
View File
@@ -448,7 +448,7 @@ def natural( text ):
def num( s ):
"Convert text segment to int if necessary"
return int( s ) if s.isdigit() else s
return [ num( s ) for s in re.split( r'(\d+)', text ) ]
return [ num( s ) for s in re.split( r'(\d+)', str( text ) ) ]
def naturalSeq( t ):
"Natural sort key function for sequences"