From fd174704641c7593b957278e13576d47daa22057 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 12 May 2014 16:40:29 +0530 Subject: [PATCH] ... --- src/calibre/utils/icu.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/calibre/utils/icu.py b/src/calibre/utils/icu.py index eafd0768e0..c930860431 100644 --- a/src/calibre/utils/icu.py +++ b/src/calibre/utils/icu.py @@ -181,7 +181,7 @@ def _make_func(template, name, **kwargs): # }}} -################# The string functions ######################################## +# ################ The string functions ######################################## sort_key = _make_func(_sort_key_template, 'sort_key', collator='_sort_collator', collator_func='sort_collator') numeric_sort_key = _make_func(_sort_key_template, 'numeric_sort_key', collator='_numeric_collator', collator_func='numeric_collator') @@ -279,10 +279,7 @@ def partition_by_first_letter(items, reverse=False, key=lambda x:x): return ans # Return the number of unicode codepoints in a string -try: - string_length = _icu.string_length if is_narrow_build else len -except AttributeError: - string_length = len # Somebody running from source with a binary that has not been updated +string_length = _icu.string_length if is_narrow_build else len ################################################################################