This commit is contained in:
Andreas Preikschat 2013-07-06 21:49:03 +02:00
parent 18c33be967
commit 2c5eb64f6e

View File

@ -395,9 +395,10 @@ def get_natural_key(string):
"""
key = DIGITS_OR_NONDIGITS.findall(string)
key = [int(part) if part.isdigit() else get_locale_key(part) for part in key]
# Python 3 does not support comparision of different types anymore. So make sure, that we do not compare str and int.
#if string[0].isdigit():
# return [''] + key
# Python 3 does not support comparision of different types anymore. So make sure, that we do not compare str
# and int.
if string[0].isdigit():
return [b''] + key
return key